Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Make layer.screenFrame a property
You can now directly get/set the screenFrame for each layer (layer.screenFrame used to be a function). I also got rid of the Frame object in many places in favor of a normal object.
- Loading branch information
Showing
5 changed files
with
86 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
layerA = new Layer x:100, y:100, width:100, height:100 | ||
layerA.clip = false | ||
layerB = new Layer x:300, y:300, width:100, height:100, backgroundColor:"red", superLayer:layerA | ||
|
||
# assert.equal layerB.screenFrame.x, 400 | ||
# assert.equal layerB.screenFrame.y, 400 | ||
|
||
# print _.pick(layerA, ["x", "y", "width", "height"]) | ||
|
||
newFrame = Utils.convertPoint({x:200, y:200}, null, layerA) | ||
|
||
print newFrame | ||
|
||
layerA = new Layer | ||
width: 100 | ||
height: 100 | ||
layerB.frame = newFrame | ||
|
||
layerB = new Layer | ||
width: 20 | ||
height: 20 | ||
superLayer: layerA | ||
print layerB.x | ||
|
||
layerB.draggable.enabled = true | ||
layerB.draggable.maxDragFrame = layerA.frame | ||
layerB.superLayer = null | ||
|
||
|
||
|
||
# assert.equal layerB.screenFrame.x, 1000 | ||
# assert.equal layerB.screenFrame.y, 1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters