Commit graph

1253 commits

Author SHA1 Message Date
kangax
21f573d381 Speed up getElementStyle 2014-02-16 16:36:13 -05:00
Michael Elsdörfer
1be7b9fee8 Fix mouse handling inside a scrollable div.
See also #870, which was incorrectly merged.
2014-02-15 03:29:22 +01: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
kangax
be96d93f6e Fix group origin after toJSON 2014-02-10 21:37:47 -05:00
RG72
107dd5735f Options for node-canvas
Allowing to write pdf via node-canvas
```var canvas = fabric.createCanvasForNode(200, 200,'pdf');
..
fs.writeFile('out.pdf', canvas.nodeCanvas.toBuffer());```
2014-02-09 12:42:15 +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
Juriy Zaytsev
0584d94a5c Merge pull request #1138 from GordoRank/Only-add-hidden-textarea-when-in-editing-mode
Fix object onClick (previously failed change)
2014-02-04 08:16:59 -08:00
GordoRank
d665ddfe81 Fix object onClick (previously failed change)
I'm unsure how but a previous change in this pull request never merged correctly (probably still due to my inexperience with github)  Regardless, this tiny patch fixes the bug
2014-02-04 09:44:49 +00:00
Juriy Zaytsev
172a3d3da2 Merge pull request #1135 from bernardofd/prJan2014
[Fix] loadSVGFromString receives raw buffer instead of string when loading SVG file from disk
2014-02-01 11:38:12 -08: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
Bernardo Figuerêdo Domingues
522a4cc1d7 Fix request_fs returns raw buffer instead of string.
Since fs.readFile returns the raw buffer if no encoding is specified, the call to loadSVGFromString would fail. This PR fixes that, transforming the buffer into string (assuming 'utf-8') encoding. For other encodings, it may garble special characters.
2014-01-30 15:34:09 -02: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
GordoRank
a962b59aa7 Iterate backwards 2014-01-27 13:05:32 +00:00
GordoRank
02d55954e9 Move check into separate function 2014-01-27 12:29:30 +00:00
kangax
f928e68386 Few small tweaks 2014-01-26 22:19:12 -05:00
mizzack
bed0cab833 Adding nullcheck to touches attr on event.
This was throwing errors in IE11 on desktop.  Not that it needs gesture support...
2014-01-26 15:36:31 -05:00
GordoRank
88157a8107 Optimize searchPossibleTargets 2014-01-24 09:44:08 +00: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
b75fa8c32d switch to 'text:selection:changed' 2014-01-23 01:32:08 +00:00
GordoRank
f6108963b2 switch to 'text:selection:changed' 2014-01-23 01:31:20 +00:00
Juriy Zaytsev
9f0f5e6bd2 Merge pull request #1111 from GordoRank/Only-add-hidden-textarea-when-in-editing-mode
Prevent multiple hidden Textareas
2014-01-22 16:44:36 -08:00
Juriy Zaytsev
c9a27eb6a0 Merge pull request #1110 from GordoRank/Fix-multiple-renderAll-when-exiting-editing-mode
Fix multiple renderAll when exiting editing mode
2014-01-22 16:36:25 -08: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
e000ed0ef0 Remove clashing 'selected' event firing 2014-01-20 09:43:36 +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
764b55ed33 Fire text:selected on selectAll 2014-01-20 08:22:02 +00:00
GordoRank
3e1433acb1 Add text:selected event 2014-01-20 08:21:00 +00:00
GordoRank
9a2d697cf2 Prevent multiple hidden Textareas
Currently a hidden ```TEXTAREA``` is created for every IText instance and remain in the DOM forever.  

This patch creates the required textarea on demand in ```enterEditing``` and destroys it in ```exitEditing```

This prevents multiple Textareas from hanging around in the DOM which can cause slowdowns in complex scenes with lots of IText instances.
2014-01-20 08:14:31 +00:00
GordoRank
b814568294 Prevent multiple RenderAll calls on exit edit
This commit modifies the ```mouseUp ```handler to fix ```enterEditing``` behaviour, while maintaining the ability to fire ```enterEditing()``` programmatically
2014-01-20 07:46:59 +00:00
GordoRank
564266e3e2 Prevent multiple RenderAll calls on exit edit
This fix prevents ```renderAll()``` being called for each IText instance when ```exitingMode``` is exited.  Only one ```renderAll()``` is necessary
2014-01-20 07:42:33 +00:00
GordoRank
d088bb1fb7 Fix IText selection with varying font widths 2014-01-20 07:28:33 +00:00