Commit graph

217 commits

Author SHA1 Message Date
kangax
0dbf03835d Fix typo, build dist 2014-02-19 14:59:50 -05:00
Juriy Zaytsev
8f2d29f5d6 Merge pull request #1172 from kreig/patch-1
fabric.Object.fillRule support using globalCompositeOperation
2014-02-19 14:44:05 -05:00
kangax
631226d26b More JSCS fixes; down to 295 failures 2014-02-17 11:55:54 -05:00
kangax
d2f6a9033e Add JSCS validation & change bunch of things for conformance. Down to 333 failures from ~1000. 2014-02-16 16:36:14 -05:00
kreig
e89c9c84bd fabric.Object.fillRule support using globalCompositeOperation
Full support for the fabric.Object.fillRule option for any visual objects.
_setupFillRule(ctx) is used to set CanvasRenderingContext2D.globalCompositeOperation (from fillRule property).
_restorFillRule(ctx) restores previously saved globalCompositeOperation.
Both methods are called form the render() method, so individual blending settings for each object can be specified.
2014-02-16 19:00:53 +02:00
kangax
0460e4e248 Fix recent group addition 2014-02-11 12:47:09 -05:00
kangax
93ac070918 Make _calcBounds more flexible 2014-02-10 23:24:29 -05:00
Maciej Filip Szkodziński
7d72d0500f Removed Line._getCenterToCenter helpers
Pre-rendering context translation for lines in path-groups uses the
pre-existing getCenterPoint.

Removed tests for removed code.
2014-02-05 17:33:20 +01:00
Maciej Filip Szkodziński
df764728e0 Fix group mocks in Line tests
Added missing semicolons in tests.

Refactored Line centerToCenterGetter to improve readability.
2014-02-05 17:07:45 +01:00
Maciej Filip Szkodziński
6b1e144c44 Line coordinates are correct
fabric.Line._setWidthHeight was assigning left and top as if both
origins were 'center'.

It now uses private helper methods to calculate the distances from
left and top edges of canvas to the line origins.

The data for existing Line.toObject test is updated with origin-relative
coordinates.

Rendering of line inside a path-group was assuming a 'center' origin
for both coordinates.

Context translation done before rendering for lines inside path-groups
now uses private helper methods to calculate distances from the center
of path-group to center of line.
2014-02-05 15:42:52 +01:00
kangax
512b0186c8 Tweak iText after PR 2014-02-01 14:24:25 -05:00
Juriy Zaytsev
4a967b7ddf Merge pull request #1114 from GordoRank/Improve-IText-performance
Improve overall IText performance with varying styles > 1000%
2014-02-01 11:22:20 -08:00
kangax
68d4a74def Tweak few things in iText; build distribution 2014-02-01 13:18:22 -05:00
Juriy Zaytsev
93bd41f356 Merge pull request #1113 from GordoRank/Reduce-calls-to-fillText/strokeText-for-IText
Reduce calls to fillText/fillStroke in IText
2014-02-01 10:15:39 -08:00
Juriy Zaytsev
213b99eb9f Merge pull request #1127 from GordoRank/Optimize-searchPossibleTargets-for-IText
Optimize searchPossibleTargets for I-text
2014-01-27 12:54:02 -08:00
kangax
e977372236 Remove node 0.6 from travis until jsdom fixes it 2014-01-23 11:25:04 -05:00
kangax
3dd2f1572d Move for in body into a separate method (to allow inlining) 2014-01-23 10:49:23 -05:00
kangax
dbbfb992cb Add all properties onto prototype (not to invalidate hidden classes) 2014-01-23 10:49:23 -05:00
GordoRank
531faae418 revert master 2014-01-23 10:15:30 +00:00
GordoRank
4183bddd26 revert 2014-01-23 10:14:58 +00:00
GordoRank
235f7add81 update cache in setElement() 2014-01-23 10:08:49 +00:00
GordoRank
c8da9fbfc3 update cache automatically in _set() 2014-01-23 10:07:33 +00:00
Juriy Zaytsev
b600c39119 Merge pull request #1112 from GordoRank/Add-textselected-event
Add "text:selection:changed" event
2014-01-22 21:48:36 -08:00
GordoRank
f6108963b2 switch to 'text:selection:changed' 2014-01-23 01:31:20 +00:00
GordoRank
4631a8929a Update itext.class.js 2014-01-20 20:59:04 +00:00
GordoRank
ab67a7d1d6 Update itext.class.js 2014-01-20 15:28:50 +00:00
GordoRank
394732f3a3 Update renderCursor/renderSelection
Update renderCursor()/renderSelection() to draw to separate canvas
2014-01-20 14:54:41 +00:00
GordoRank
e3dd37ff22 remove IText _render()
The ```the _render()``` method for IText objects is no longer needed when since rendering cursor/selection is now handled elsewhere
2014-01-20 14:51:21 +00:00
GordoRank
40b04c7b11 Let _getWidthOfChar() return cached values 2014-01-20 11:19:01 +00:00
GordoRank
cec2a17a47 Remove clashing 'selected' event firing 2014-01-20 09:43:00 +00:00
GordoRank
8cf567522d Update itext.class.js 2014-01-20 08:50:02 +00:00
GordoRank
72e1b91ee4 Reduce calls to fillText/fillStroke in IText 2014-01-20 08:42:24 +00:00
GordoRank
3e1433acb1 Add text:selected event 2014-01-20 08:21:00 +00:00
GordoRank
d088bb1fb7 Fix IText selection with varying font widths 2014-01-20 07:28:33 +00:00
kangax
f1aef7ed1a Version 1.4.3 2014-01-18 12:01:19 -05:00
kangax
bc8acac692 Only call _renderStroke in line and circle when this.stroke exists 2014-01-17 11:57:54 -05:00
kangax
20e0712688 Avoid set in fabric.Line#_setWidthHeight 2014-01-17 11:57:31 -05:00
kangax
13fcf15b8b Make sure compiler can inline 2014-01-17 11:51:16 -05:00
kangax
4761c2527c Build distribution 2014-01-14 12:57:13 -05:00
Juriy Zaytsev
d4ea2c6f1e Merge pull request #1097 from GordoRank/master
Rewrite renderSelection to only draw once per line
2014-01-14 09:46:16 -08:00
GordoRank
0abc547d6b Fixed formatting and cache start.lineIndex 2014-01-14 17:37:40 +00:00
kangax
166dc60716 Fix JSHint warnings, build distribution 2014-01-14 12:34:32 -05:00
GordoRank
9f2c678a66 Formatting fixed and end.lineIndex cached 2014-01-14 17:23:40 +00:00
GordoRank
350261437a Rewrite renderSelection to only draw once per line
Previously RenderSelection performed a fillRect() command for every character.  This resulted in poor performance on large bodies of text.  This rewrite calculates the selection box for each line of text and draws a single rectangle for each line, dramatically improving performance.
2014-01-14 17:09:19 +00:00
GordoRank
90a97e6272 Fix click cursor placement on center/right text
This clamps the click cursor placement so that clicking to the left of a short first line of centered/right aligned text positions the cursor to the left of the first character in the line....

Previously in that instance it would move to the left boundary instead
2014-01-14 15:48:59 +00:00
GordoRank
272859b8f1 Formatting fixes 2014-01-14 11:03:27 +00:00
GordoRank
55bc6a990b Make flashing cursor behave like MSWord 2014-01-13 12:04:46 +00:00
Juriy Zaytsev
bb7f52cc84 Merge pull request #1088 from Kienz/patch-2
Fix path regExp for compressed path commands
2014-01-12 06:37:46 -08:00
Kienz
da0866429a Initialize fabric.IText canvas handlers only once. Closes #1076
Qunit additions
2014-01-12 15:32:50 +01:00
Kienz
61f65bc206 Fix path regExp for compressed path commands
Fix regExp for e^x numbers
Add unit test for e^x numbers
2014-01-12 13:50:03 +01:00