Performance issues when changing nodes bounds

9 views
Skip to first unread message

Mustafa Shujaie

unread,
Nov 19, 2014, 2:08:48 AM11/19/14
to piccolo...@googlegroups.com
Hi, I am new to Piccolo2D and I am using it in a real world project. My scenario is that I have a parent PNode object which contains other PNodes. Each node in this hierarchy is called Rectangle in my case. A rectangle can be divided into multiple rectangles vertically or horizontally, and siblings are separated by a Bar object. the Bar object has references to it's previous and next rectangles. When the bar's position is changed it also changes it's previous rectangle and next rectangles, So the next rectangle and previous rectangles are always linked together by the Bar object logically and visually. Overall hierarchy of my objects are like Java Swing's BoxLayout where a Panel may be divided horizontally or vertically in rows and columns. Also each row and column may be divided further in this way.
When I resize or rearrange the structure I put some constraints by overriding the setBounds() method of the rectangle. I want to know is there any performance difference between manipulating a node's bounds or its transform?
I noticed that the PPath's super class which is Shape I think uses affineTransform to update it's dimension and position.
After all I want to know what is the best way in terms of performance in changing a node's bounds?

By the way I appreciate your responses and sorry for my bad English.
Reply all
Reply to author
Forward
0 new messages