File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,7 @@ class ComponentImpl extends ComponentBase {
243243 }
244244 }
245245
246+ private var _componentOffset : Point = new Point (0 , 0 );
246247 private override function getComponentOffset (): Point {
247248 var p : DisplayObjectContainer = this ;
248249 var s : DisplayObjectContainer = null ;
@@ -254,10 +255,13 @@ class ComponentImpl extends ComponentBase {
254255 p = p .parent ;
255256 }
256257 if (s == null ) {
257- return new Point (0 , 0 );
258+ _componentOffset .x = 0 ;
259+ _componentOffset .y = 0 ;
260+ } else {
261+ _componentOffset .x = s .x ;
262+ _componentOffset .y = s .y ;
258263 }
259- var globalPoint = s .localToGlobal (new openfl.geom. Point (0 , 0 ));
260- return new Point (globalPoint .x , globalPoint .y );
264+ return _componentOffset ;
261265 }
262266
263267 private override function handleFrameworkProperty (id : String , value : Any ) {
You can’t perform that action at this time.
0 commit comments