Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
96d7ce0d
Commit
96d7ce0d
authored
Nov 12, 2020
by
Roman Sedaikin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed skia layer location on macos.
parent
f89c3902
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
HardwareLayer.kt
...o/src/jvmMain/kotlin/org/jetbrains/skiko/HardwareLayer.kt
+6
-0
drawlayer.m
skiko/src/jvmMain/objectiveC/macos/drawlayer.m
+4
-7
No files found.
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/HardwareLayer.kt
View file @
96d7ce0d
...
@@ -2,6 +2,8 @@ package org.jetbrains.skiko
...
@@ -2,6 +2,8 @@ package org.jetbrains.skiko
import
java.awt.Graphics
import
java.awt.Graphics
import
java.awt.Canvas
import
java.awt.Canvas
import
javax.swing.SwingUtilities.convertPoint
import
javax.swing.SwingUtilities.getRootPane
open
class
HardwareLayer
:
Canvas
(),
Drawable
{
open
class
HardwareLayer
:
Canvas
(),
Drawable
{
override
fun
paint
(
g
:
Graphics
)
{
override
fun
paint
(
g
:
Graphics
)
{
...
@@ -19,4 +21,8 @@ open class HardwareLayer : Canvas(), Drawable {
...
@@ -19,4 +21,8 @@ open class HardwareLayer : Canvas(), Drawable {
external
get
external
get
override
val
contentScale
:
Float
override
val
contentScale
:
Float
get
()
=
graphicsConfiguration
.
defaultTransform
.
scaleX
.
toFloat
()
get
()
=
graphicsConfiguration
.
defaultTransform
.
scaleX
.
toFloat
()
val
absoluteX
:
Int
get
()
=
convertPoint
(
this
,
x
,
y
,
getRootPane
(
this
)).
x
val
absoluteY
:
Int
get
()
=
convertPoint
(
this
,
x
,
y
,
getRootPane
(
this
)).
y
}
}
\ No newline at end of file
skiko/src/jvmMain/objectiveC/macos/drawlayer.m
View file @
96d7ce0d
...
@@ -90,9 +90,6 @@ JavaVM *jvm = NULL;
...
@@ -90,9 +90,6 @@ JavaVM *jvm = NULL;
-
(
void
)
syncLayersSize
-
(
void
)
syncLayersSize
{
{
self
.
glLayer
.
bounds
=
self
.
container
.
bounds
;
self
.
glLayer
.
frame
=
self
.
container
.
frame
;
if
(
jvm
!=
NULL
)
{
if
(
jvm
!=
NULL
)
{
JNIEnv
*
env
;
JNIEnv
*
env
;
(
*
jvm
)
->
AttachCurrentThread
(
jvm
,
(
void
**
)
&
env
,
NULL
);
(
*
jvm
)
->
AttachCurrentThread
(
jvm
,
(
void
**
)
&
env
,
NULL
);
...
@@ -122,22 +119,22 @@ JavaVM *jvm = NULL;
...
@@ -122,22 +119,22 @@ JavaVM *jvm = NULL;
static
jmethodID
getXMethod
=
NULL
;
static
jmethodID
getXMethod
=
NULL
;
if
(
!
getXMethod
)
if
(
!
getXMethod
)
{
{
getXMethod
=
(
*
env
)
->
GetMethodID
(
env
,
wndClass
,
"getX"
,
"()I"
);
getXMethod
=
(
*
env
)
->
GetMethodID
(
env
,
wndClass
,
"get
Absolute
X"
,
"()I"
);
}
}
if
(
NULL
==
getXMethod
)
if
(
NULL
==
getXMethod
)
{
{
NSLog
(
@"The method HardwareLayer.getX() not found!"
);
NSLog
(
@"The method HardwareLayer.get
Absolute
X() not found!"
);
return
;
return
;
}
}
static
jmethodID
getYMethod
=
NULL
;
static
jmethodID
getYMethod
=
NULL
;
if
(
!
getYMethod
)
if
(
!
getYMethod
)
{
{
getYMethod
=
(
*
env
)
->
GetMethodID
(
env
,
wndClass
,
"getY"
,
"()I"
);
getYMethod
=
(
*
env
)
->
GetMethodID
(
env
,
wndClass
,
"get
Absolute
Y"
,
"()I"
);
}
}
if
(
NULL
==
getYMethod
)
if
(
NULL
==
getYMethod
)
{
{
NSLog
(
@"The method HardwareLayer.getY() not found!"
);
NSLog
(
@"The method HardwareLayer.get
Absolute
Y() not found!"
);
return
;
return
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment