r00tat / wificompass

Automatically exported from code.google.com/p/wificompass
9 stars 10 forks source link

Relative and absolute positions of sub-drawables are not correctly calculated when pivot point is non-centered #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a sub-drawable with a non-center pivot point (e.g., 0.8f and 0.2f)
2. Make it scalable and rotatable
3. Add it to another scalable and rotatable drawable as a sub-drawable
4. Scale and rotate the super-drawable
5. Scale and rotate the sub-drawable

What is the expected output? What do you see instead?
The relative position of the dragged, scaled and rotated object should be it's 
pivot point. Right now, this only works if the pivot point is in the center of 
the object OR if the sub-drawable isn't scalable or rotatable at all.

Original issue reported on code.google.com by tkon...@gmx.net on 21 Mar 2012 at 11:05

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r106.

The calculation of the values minX and minY was slightly inaccurate due to the 
fact that the scale factors were not reset to 1.0f in the setPos() function 
when the object isn't scalable. This led to scale factors slightly lower or 
higher than 1.0f, and forced the Android canvas engine to scale the Drawables 
slightly even though this was not necessary. This is also a minor performance 
improvement when many non-scalable sub-drawables are used (such as 
MeasuringPoints inside the SiteMap). Hooray!

Update issue #9
Removed the boolean "isCustomPivotUsed". It is now supposed that if the pivot 
point equals 0.5f / 0.5f (which is the default value of the variable), then the 
pivot is default. Any other value is non-default and returns "true" when 
"isCustomPivotUsed()" is called.

Original comment by tkon...@gmx.net on 21 Mar 2012 at 11:10

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r107.

Removed an unnecessary Logger command.

Original comment by tkon...@gmx.net on 21 Mar 2012 at 11:17

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r108.

Relative and absolute positions are now correctly calculated in case *no 
rotation* is used at all (neither for the super-drawable nor for the 
sub-drawable).

Original comment by tkon...@gmx.net on 21 Mar 2012 at 2:24

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r109.

Relative and absolute positions are now correctly calculated in case *no 
rotation* is used at all (neither for the super-drawable nor for the 
sub-drawable).

Original comment by tkon...@gmx.net on 21 Mar 2012 at 2:37

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r110.

Relative and absolute positions are now correctly calculated, even with 
rotation of both super-drawabales and sub-drawables. Remaining problem: the 
sub-drawable jumps when dragged.

Original comment by tkon...@gmx.net on 21 Mar 2012 at 3:31

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r111.

Original comment by tkon...@gmx.net on 21 Mar 2012 at 4:15