From 5d00c30ececfad91d429a86f6d5d35b68209e1b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 7 Jun 2017 16:56:44 +0200 Subject: [PATCH] Some internal refactoring. --- src/basic/Point.js | 2 +- src/basic/Rectangle.js | 4 ++-- src/item/Item.js | 6 +++--- src/path/PathItem.Boolean.js | 2 +- src/path/Segment.js | 4 ++-- src/path/SegmentPoint.js | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/basic/Point.js b/src/basic/Point.js index effb42d4..e9b260dd 100644 --- a/src/basic/Point.js +++ b/src/basic/Point.js @@ -1067,7 +1067,7 @@ var LinkedPoint = Point.extend({ }, setSelected: function(selected) { - this._owner.changeSelection(this._getSelection(), selected); + this._owner._changeSelection(this._getSelection(), selected); }, _getSelection: function() { diff --git a/src/basic/Rectangle.js b/src/basic/Rectangle.js index 7e86fdfc..0a2cae29 100644 --- a/src/basic/Rectangle.js +++ b/src/basic/Rectangle.js @@ -957,8 +957,8 @@ new function() { setSelected: function(selected) { var owner = this._owner; - if (owner.changeSelection) { - owner.changeSelection(/*#=*/ItemSelection.BOUNDS, selected); + if (owner._changeSelection) { + owner._changeSelection(/*#=*/ItemSelection.BOUNDS, selected); } } }) diff --git a/src/item/Item.js b/src/item/Item.js index 08882ff0..6b8183f2 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -555,7 +555,7 @@ new function() { // Injection scope for various item event handlers } }, - changeSelection: function(flag, selected) { + _changeSelection: function(flag, selected) { var selection = this._selection; this.setSelection(selected ? selection | flag : selection & ~flag); }, @@ -602,7 +602,7 @@ new function() { // Injection scope for various item event handlers for (var i = 0, l = children.length; i < l; i++) children[i].setSelected(selected); } - this.changeSelection(/*#=*/ItemSelection.ITEM, selected); + this._changeSelection(/*#=*/ItemSelection.ITEM, selected); }, isFullySelected: function() { @@ -624,7 +624,7 @@ new function() { // Injection scope for various item event handlers for (var i = 0, l = children.length; i < l; i++) children[i].setFullySelected(selected); } - this.changeSelection(/*#=*/ItemSelection.ITEM, selected); + this._changeSelection(/*#=*/ItemSelection.ITEM, selected); }, /** diff --git a/src/path/PathItem.Boolean.js b/src/path/PathItem.Boolean.js index 3a7fe82d..cb0d4534 100644 --- a/src/path/PathItem.Boolean.js +++ b/src/path/PathItem.Boolean.js @@ -1001,7 +1001,7 @@ PathItem.inject(new function() { if (finished) { if (closed) { // Carry over the last handleIn to the first segment. - path.firstSegment.setHandleIn(handleIn); + path.getFirstSegment().setHandleIn(handleIn); path.setClosed(closed); } // Only add finished paths that cover an area to the result. diff --git a/src/path/Segment.js b/src/path/Segment.js index c372b7d9..298065ec 100644 --- a/src/path/Segment.js +++ b/src/path/Segment.js @@ -288,7 +288,7 @@ var Segment = Base.extend(/** @lends Segment# */{ } }, - changeSelection: function(flag, selected) { + _changeSelection: function(flag, selected) { var selection = this._selection; this.setSelection(selected ? selection | flag : selection & ~flag); }, @@ -313,7 +313,7 @@ var Segment = Base.extend(/** @lends Segment# */{ }, setSelected: function(selected) { - this.changeSelection(/*#=*/SegmentSelection.ALL, selected); + this._changeSelection(/*#=*/SegmentSelection.ALL, selected); }, /** diff --git a/src/path/SegmentPoint.js b/src/path/SegmentPoint.js index 2ea2835d..2289bda0 100644 --- a/src/path/SegmentPoint.js +++ b/src/path/SegmentPoint.js @@ -85,7 +85,7 @@ var SegmentPoint = Point.extend({ }, setSelected: function(selected) { - this._owner.changeSelection(this._getSelection(), selected); + this._owner._changeSelection(this._getSelection(), selected); }, _getSelection: function() {