Jürg Lehni
50e1509ab9
Simplify some code in #getAverageColor().
2011-12-27 20:39:46 +01:00
Jürg Lehni
24c0d0f87e
Fix bug in Raster#getAverageColor().
2011-12-27 19:55:55 +01:00
Jürg Lehni
5093648bd1
Shorten code a bit.
2011-12-27 19:53:37 +01:00
Jürg Lehni
b832787f7f
Fix issues with multiple instances of symbols appearing in the wrong positions.
...
This was caused by cached bounds rectangles being modified elsewhere.
2011-12-27 19:53:28 +01:00
Jürg Lehni
2249f09223
Minor code clean up.
...
No need to set reference again, since we're directly modifying it.
2011-12-26 11:16:16 +01:00
Jürg Lehni
dbd3eff84b
Don't forget to set #_bounds again if recycling.
...
This fixes the other observed slowdown since the bounds caching code overhaul.
2011-12-26 11:15:47 +01:00
Jürg Lehni
873cd79517
Fix a bug in code that keeps #_position cache up to date.
...
Only happened in items that assign another type to 'bounds' through _boundsType, e.g. PlacedSymbol, leading to substantial slow downs.
2011-12-26 11:08:09 +01:00
Jürg Lehni
d2869cfd55
Cached bounds are no longer LinkedRectangles.
2011-12-26 11:06:04 +01:00
Jürg Lehni
c552925426
Fix issue with Item#removeChildren(from, to) removing too many items.
2011-12-26 02:39:54 +01:00
Jürg Lehni
1e690a68e0
Add TODO about HitResult points requiring transformations.
2011-12-25 12:39:10 +01:00
Jürg Lehni
951a3aea99
Inverse-transform the passed point on each DOM level in #hitTest().
2011-12-25 00:19:44 +01:00
Jürg Lehni
c30ff47930
Remove matrix argument from all hit-testing related methods.
...
We better inverse-transform the point and save the code!
2011-12-25 00:19:01 +01:00
Jürg Lehni
1eadc87b58
No need to calculate matrix before handling cached values.
2011-12-24 12:30:43 +01:00
Jürg Lehni
733d879bb6
Add / improve comments about DOCS.
2011-12-23 22:47:10 +01:00
Jürg Lehni
97b66582f8
Rename Item#applyMatrix() to shorter #apply().
2011-12-23 22:41:05 +01:00
Jürg Lehni
61dca0b4d0
Introduce standard way of passing matrices/points to Item constructors.
2011-12-20 23:33:53 +01:00
Jürg Lehni
f2d7b85616
Introduce Matrix#setIdentity().
2011-12-20 23:14:30 +01:00
Jürg Lehni
a8392fbf68
Implement local caching for the calculation of concatenated global matrices in the drawing of selected items in Project#draw().
2011-12-20 23:09:49 +01:00
Jürg Lehni
8888ca912a
The internal Item#_position is no longer a LinkedPoint.
...
Make sure it stays that way when it's kept up-to-date in Item#transform().
2011-12-20 22:35:06 +01:00
Jürg Lehni
0592038b9f
Remove debugging code that lead to slow-down regressions.
2011-12-20 22:34:08 +01:00
Jürg Lehni
93ede28f3b
Implement new selection drawing mechanism.
...
Using the new Item#globalMatrix.
2011-12-20 11:42:00 +01:00
Jürg Lehni
89a1d2fe73
Define Item#globalMatrix.
...
For now uncached.
2011-12-20 11:39:36 +01:00
Jürg Lehni
4a46c8ac98
Fix recently introduced error with stroke/fillColor handling
...
Since CanvasContext#stroke/fillStyle cannot be set to null, we have to keep checking Style#fill/strokeColor even after calling #_setStyles().
2011-12-19 23:07:14 +01:00
Jürg Lehni
cc26fdc5d1
Optimise handling and setting of fill and stroke styles.
...
Handle setting of fillColor and strokeColor in Item#_setStyles() instead of the various #draw() methods, directly access internal styles instead of using accessor calls and fix PointText#draw().
2011-12-19 22:40:14 +01:00
Jürg Lehni
ea0eaf04ea
Make TextItem#style a reference to #characterStyle.
...
Internally, CharacterStyle extends PathStyle and is now stored in TextItem#_style.
2011-12-19 22:26:09 +01:00
Jürg Lehni
19429d9b6d
Automate generation of style accessors through Style class.
...
Shaving off some byes by adding more magic.
2011-12-19 22:14:10 +01:00
Jürg Lehni
f5c1125709
Move Path#_setStyles() to Item, so it can be used in PointText too.
2011-12-19 21:25:39 +01:00
Jürg Lehni
e89b2e5be1
Remove recursive argument from Item#applyMatrix().
...
Always apply transforms recursively.
2011-12-19 21:20:10 +01:00
Jürg Lehni
4514c63ed4
Merge remote-tracking branch 'origin/master'
2011-12-18 21:30:22 +01:00
Jürg Lehni
e52d2a08b8
Use correct flags in _changed() call.
2011-12-18 16:56:18 +01:00
Jürg Lehni
554047ae38
Expose Item#_getCachedBounds and use it in PlacedSymbol for proper handling of nested matrices.
2011-12-18 16:55:56 +01:00
Jürg Lehni
d2b1c77686
No need to call #getDefinition() internally.
...
Use private value directly.
2011-12-18 16:55:24 +01:00
Jürg Lehni
9e5eb17264
Improve Item#transform() and implement #applyMatrix() to support nested matrices. Work in progress.
2011-12-18 16:54:21 +01:00
Jonathan Puckey
7fdb01cf77
More work on Item event handling documentation.
2011-12-07 12:45:04 +01:00
Jonathan Puckey
1414500f45
First version of documentation of Item event handlers and MouseEvent.
2011-12-01 11:57:10 +01:00
Jürg Lehni
6e5e54cfe6
Change sequence of position / bounds related properties.
2011-11-30 18:36:44 +01:00
Jürg Lehni
f895d3e6fb
Fix recently introduced error in Item#setSelected().
2011-11-30 18:28:11 +01:00
Jürg Lehni
a26bc87686
Implement support for Item#matrix in Item#draw().
2011-11-30 18:19:23 +01:00
Jürg Lehni
a57070e4a3
Fix bounds caching issues on Group.
2011-11-30 18:18:51 +01:00
Jürg Lehni
a3ec184873
Add dontLink argument to Item#getPosition()
...
And use it to optimise up #setPosition().
2011-11-30 18:18:24 +01:00
Jürg Lehni
bb1d436281
Move creation of LinkedRectangle for 'bounds' to bounds accessor.
2011-11-30 17:20:29 +01:00
Jürg Lehni
3ece08bea1
Fix handling of recursion in Item#setSelected() / #setFullySelected().
2011-11-30 17:16:52 +01:00
Jürg Lehni
cf4c2b4919
Move #matrix accessor from PlacedItem to Item.
2011-11-29 17:19:31 +01:00
Jürg Lehni
5ff3a07b31
Add comment about 1px rectangle in Raster#getAverageColor().
2011-11-29 17:19:15 +01:00
Jürg Lehni
b5e46971f0
Replace new Size(x, y) calls with internal Size.create(x, y).
2011-11-29 17:11:15 +01:00
Jürg Lehni
26210fb95b
Implement transforming of cached bounds again, if possible.
2011-11-28 23:20:47 +01:00
Jürg Lehni
cadc2e78ca
We can directly access Item#_id.
...
No need to call Item#getId() internally.
2011-11-28 23:14:02 +01:00
Jürg Lehni
cb8c94ef7e
Recursively call _clearBoundsCache
...
If the cache for an item's children is not valid anymore, that needs to propagate up the DOM tree.
2011-11-28 23:13:31 +01:00
Jürg Lehni
d3c83be3bb
Correct execution sequence in getBounds so that the parent's _boundsCache is kept up to date even when the child is returning a cached result.
2011-11-28 22:59:25 +01:00
Jürg Lehni
e82deff4b9
Fix the drawing of PlacedSymbol bounds when selected.
2011-11-27 14:55:49 +00:00