Commit graph

2716 commits

Author SHA1 Message Date
Andrea Bogazzi
e70e65fe92
isEmptyStyles for textbox (#4762)
* isEMptyStyles for textbox
* added tests
* added missing file
2018-02-24 18:45:23 +01:00
Stefan Hayden
71b28012fc cleanup function to be more readable (#4756)
* cleanup function to be more readable

* update style variable to be more descriptive and use the styleObject reference in one more place
2018-02-21 18:03:11 +01:00
Andrea Bogazzi
3a92eb92ae
test (#4753) 2018-02-21 12:02:49 +01:00
yao
f855bbcbf3 add drawDot func to pencilbrush (#4743) 2018-02-21 11:20:43 +01:00
Stefan Hayden
d1e5337c2d ensure canBeSwapped can only be true when a style prop has actually been set to a value (#4751) 2018-02-20 21:53:54 +01:00
scriptspry
d569407d3a Fixes StaticCanvas.onBeforeScaleRotate not triggering when canvas is zoomed (#4748)
* Fixed StaticCanvas.onBeforeScaleRotate not getting triggered when canvas is zoomed.

* Added test for Canvas._beforeTransform.
2018-02-20 20:41:42 +01:00
Andrea Bogazzi
b47815e411
added image crop ToSVG support (#4738)
* added svg crop support
2018-02-18 23:50:08 +01:00
Andrea Bogazzi
2e532cc362
Limit sin and cosin very small floats on 90/270 degrees (#4734)
* so far ok

* fix transformations decimal

* remove some changes

* less changes

* test passing

* less calculation

* added shortcut

* modified tests
2018-02-18 15:56:27 +01:00
Dennis Keck
687cd7b495 Update brightness_filter documentation (#4727)
The value range for brightness changed to floating point range [-1.0,1.0]
2018-02-18 09:45:46 +01:00
Andrea Bogazzi
75ba9e1ac8
fixed filter (#4706) 2018-02-10 13:14:26 +01:00
Andrea Bogazzi
361db0b8a2
added test for dataUrl (#4705) 2018-02-10 13:12:00 +01:00
Andrea Bogazzi
d8dab88a46
Fix originX and originY missing in the matrix cacheKey (#4703)
* added test
* fixed the typo
2018-02-10 12:16:09 +01:00
JC
a14b9722ba #4693: multiplier in toDataURL is not working (#4698) 2018-02-10 11:43:40 +01:00
Stefan Hayden
e13bc33c63 do not mutate passed object to fromObject (#4699)
* do not mutate passed object to fromObject

* add a test

* this is what you get for editing in github.com
2018-02-10 00:46:28 +01:00
Andrea Bogazzi
dea22aca70
Fixes (#4674)
* default no retina for dataurl
* make num_fraction_digits variable
* restored aborted changes
* mispelled param
* added test for SVG
* added test for toDataUrl
* how it could even run
* simpler test
* i hope they will pass now
* fed up
* completely cheating
* fallback on dumb test
* test also this
* test also this
* more tests
2018-02-04 22:42:32 +01:00
Andrea Bogazzi
6d0ad48224
safeguard canvas (#4650) 2018-01-28 12:51:51 +01:00
Andrea Bogazzi
2f19c8c7e8
fix calcOffset when text enter editing (#4649) 2018-01-26 22:49:39 +01:00
Andrea Bogazzi
4f446020ba
added a simple test (#4647) 2018-01-26 11:12:27 +01:00
Andrea Bogazzi
43ebcd8278
Gradient fix parsing floats (#4637)
* fixed gradient parsing and circle width/height leak

* added a small test

* fix lint

* test re enabled

* fixed tests
2018-01-20 01:09:47 +01:00
Andrea Bogazzi
6309387665
Add CrossOrigin managment to fabric.Pattern (#4618)
* added crossOrigin

* adding tests

* added some basic test
2018-01-18 08:39:02 +09:00
DangerD256
8792d83679 Add patternTransform toObject saving (#4626)
* Add patternTransform toObject saving
* Update pattern.class.js
2018-01-17 20:46:59 +09:00
Andrea Bogazzi
0a7aba74ee
GIving brushes a _render method (#4613)
* solves error

* rerender just if there is an activeObject
2018-01-12 07:30:53 +09:00
Andrea Bogazzi
df48f43f14
avoid charspacing shortcut (#4594) 2017-12-30 11:57:38 +01:00
Justin Parker
4846789bf0 Fix color toHexa() (#4579)
* Failing Color.toHexa() test

* fix color toHexa() to not give decimals

* fix hexa test due to rounding
2017-12-27 10:05:40 +01:00
Andrea Bogazzi
69439efe92
minor changes to event (#4561) 2017-12-14 21:42:13 +01:00
Andrea Bogazzi
38fcf8e274
Fix the wrapper (#4554) 2017-12-13 00:08:57 +01:00
Asturur
2a7e6919f8 corrected some jsdocs 2017-12-11 10:52:44 +01:00
Andrea Bogazzi
fb13ed0bdf
Insert a method to insert text programmatically (#4551)
* sofar

* test
2017-12-10 21:13:38 +01:00
laof
168ce21794 Deleting a disagreeable line; (#4549)
Extra closepath on control drawing
2017-12-10 09:15:01 +01:00
Andrea Bogazzi
036e1a71ee
Remove extra code from Circle/Triangle (#4547)
* removed code

* removed code

* removed code
2017-12-09 11:32:26 +01:00
Andrea Bogazzi
891a8e096e
handle top canvas in resize/renderAll (#4527)
* handle top canvas in resize/renderAll

* fix brush
2017-12-03 17:15:46 +01:00
Andrea Bogazzi
587d0657d6
fixed wrapped lines (#4526) 2017-12-02 21:18:41 +01:00
Asturur
d276707e2d add strokewdith to cachekey 2017-12-02 11:29:15 +01:00
Andrea Bogazzi
c96bb92705
Reinsert text shortcut for some cases (#4519)
* test

* use simple text line not grapheme
2017-12-02 11:24:03 +01:00
Andrea Bogazzi
88a2c7c64a
remove extra tab and newlines (#4524) 2017-12-02 11:11:11 +01:00
Andrea Bogazzi
1d57f499c6
sovled small things (#4518) 2017-11-30 11:34:18 +01:00
Jérôme Steunou
7b64898d72 Add an option to selection objects only when 100% intersect (#4508)
* Add an option to selection objects only when 100% intersect

* Better description

* Cache property negation

* Add unit tests

* Remove boundary tests, not specific to this option
2017-11-29 12:40:17 +01:00
Andrea Bogazzi
0496c0d120
update to rc3 (#4499) 2017-11-25 16:43:39 +01:00
Andrea Bogazzi
71b36f6228
Node canvas (#4497)
* readded

* paused

* test

* try jsdom

* restore node methods

* restored

* restored

* fix tests
2017-11-24 19:00:47 +01:00
Andrea Bogazzi
a9eacc4d74
Remove chars from to (#4495)
* trying to fix

* make removeChars

* fixed doc

* added test
2017-11-24 17:26:38 +01:00
Asturur
0730e9cda2 fix typo on hovercursor 2017-11-24 12:00:01 +01:00
Andrea Bogazzi
fd14303dae
Fix drawing of a point (#4492)
* initialize at 1

* added tests

* added test file
2017-11-24 11:36:36 +01:00
Andrea Bogazzi
a9d2fb1ba5
Fix scaling issues that involves width/height (#4491)
* fixed
* added a small test
* typo
2017-11-23 18:04:54 +01:00
Jérôme Steunou
91de6d078d Remove push on shared array (#4478)
follow up for #4465
2017-11-20 13:16:18 +01:00
Andrea Bogazzi
031531b218
Reduce leaks in NODEJS continue canvas creations (#4471)
* reduce leaks in node

* fix test
2017-11-19 23:41:42 +01:00
Andrea Bogazzi
7eea5228b9
removed specific node code (#4470)
* removed node code

* fixed UTs
2017-11-19 20:00:01 +01:00
Andrea Bogazzi
841e77ebb9
re enable resize filter (#4469) 2017-11-19 16:30:06 +01:00
Andrea Bogazzi
57c5d5150c
removed extra padding (#4467) 2017-11-18 16:59:10 +01:00
Andrea Bogazzi
0df3f55dc3
removed this.ctx (#4466) 2017-11-17 23:54:15 +01:00
Andrea Bogazzi
c975247db8
removed array reference for _dimensionsAffectingProps (#4465)
* removed array reference

* better to concat

* better visibility
2017-11-17 19:45:48 +01:00
Andrea Bogazzi
10a8684192
Proposal for different lineJustify. (#4437)
* not even tested

* Small fixes (#4441)

* fixed selection

* fixed svg export
2017-11-12 23:00:59 +01:00
Andrea Bogazzi
51a9e87854
fixed group restoring internal absolute coords for subtarget check (#4454)
* fixed group restoring internal cords

* added small test
2017-11-12 15:54:33 +01:00
Andrea Bogazzi
d65b5dd5a1
removed with dims (#4453) 2017-11-12 15:18:28 +01:00
Andrea Bogazzi
61c415be26
Partially solve cache fuzzyness (#4452)
* made less funzzy

* solved lint

* cleaned a bit

* fixed tests
2017-11-12 14:59:36 +01:00
Andrea Bogazzi
a2f9c9f205
Fix image import from SVG when width/height are larger than element (#4450)
* fixed

* removed extra function;

* fix import of preserver

* added tests

* fixed test names
2017-11-12 01:30:22 +01:00
Andrea Bogazzi
ece82e6b94
stop searching target on mousemove on transform (#4442) 2017-11-08 21:00:56 +01:00
Andrea Bogazzi
ef85ed7eef
Ab webgl filter for resize (#4426)
* test another version

* a working webgl resize

* broke blur"

* broke blur"

* a working webgl resize

* better cache shader

* no dist

* better

* better2

* fixed tests

* linting
2017-11-04 11:57:05 +01:00
Sander Sink
1435e862d5 Downgrading webGL precision if target hardware does not support highest (#4433)
* Downgrading webGL precision if target hardware does not support highest

* moved webGlPrecision to fabric property
2017-10-31 21:48:51 +01:00
Andrea Bogazzi
a090a980d0 Fixing text insertion and deletion on edge cases. (#4420)
* fix insertion

* fixed forward delete on line start
2017-10-27 13:28:29 +02:00
Andrea Bogazzi
073a892993 more setCoords (#4419) 2017-10-27 11:14:59 +02:00
Stefan Hayden
863eec4303 object_stacking fix (#4394)
* when calling moveTo on an activeSelection the code should move the objects in the canvas._objects stack instead of moveing the objects in the activeObject._objects stack. This already works correctly for moveForward / moveBack / ect.

* Update activeselection.js

* fix trailing spaces

* Update activeselection.js
2017-10-27 09:40:47 +02:00
Andrea Bogazzi
40f16a9b4e Memoize transform and use transform for rendering (#4418)
* done

* done removed dist

* added some test
2017-10-27 09:01:32 +02:00
Andrea Bogazzi
3244f6c0ae Change the logic for setting dirty flag (#4417)
* test

* add better set support

* no build dist
2017-10-27 06:11:28 +02:00
Andrea Bogazzi
141f60aea7 Make generic _set aware of real change property (#4415)
* first change

* added a small test
2017-10-26 11:03:35 +02:00
Asturur
c6787042a9 fix lint 2017-10-25 23:39:19 +02:00
Melvyn Hills
0ddf90c255 Add browserShadowBlurConstant to adjust shadowBlur value (#4413)
* Expose browserShadowBlurConstant to adjust shadowBlur value (#4402)
* Add test for fabric.browserShadowBlurConstant
* added test description in case of failure
2017-10-25 23:33:58 +02:00
Andrea Bogazzi
2e337613b0 Fix set element not clearing webgl texture cache (#4410)
* fix and test

* fix test
2017-10-25 10:09:10 +02:00
Anton Pawlik
3efd895fe0 Fix comments about setOverlayColor (#4381) 2017-10-13 13:07:51 +02:00
Asturur
d1cff09104 fix mousemove and target 2017-10-09 02:11:15 +02:00
Andrea Bogazzi
b1f0f67669 fix the displacement of last or first point checking direction (#4377)
* fix the displacement of last or first point checking direction

* fixed doc
2017-10-08 20:04:31 -04:00
Andrea Bogazzi
32dea1ef0b Text minor changes (#4367)
* minor changes

* argh

* minor text changes
2017-10-01 00:13:56 -04:00
Stefan Hayden
8f4fb458bf change selectionKey interface to not be a breaking change but still accept an array (#4363) 2017-09-30 23:18:03 -04:00
Brian Chitester
d88af28af7 Allow multiple keys to enable multiple click selection (#4184)
* Allow multiple keys to enable multiple click selection

* backwards compatibility: allow string or array

* do isArray properly

* forgot a this.

* formatting...

* more formatting...
2017-09-29 13:40:36 -04:00
Wietse Wind
052631bdcb Fix IE rendering of SVG as overlay image (#4324)
* Fix IE rendering of SVG as overlay image

* Fix IE rendering of SVG as overlay image #2 - Fix coding syntax (CI)

* Fix IE rendering of SVG as overlay image #3 - Fix coding syntax (CI)

* Fix IE rendering of SVG as overlay image #4 - Moved to method 'loadImageInDom'

* Fix IE rendering of SVG as overlay image #5 - Moved some stuff around

* Fix IE rendering of SVG as overlay image #6 - Fixed the setTimeout (removed)

* Update misc.js
2017-09-29 00:36:00 -04:00
Andrea Bogazzi
3884824f46 Do not scale cache for transform target (#4358)
* no scaling cache for the current target

* .
2017-09-29 00:02:43 -04:00
Andrea Bogazzi
d4b51aec6c added old props to selection:updated and selection:created (#4357)
* added old props

* added a test
2017-09-28 23:53:07 -04:00
Andrea Bogazzi
d11c55e9cd Make scaleToWidth/scaleToHeight use the absolute parameter (#4350)
* added absolute param to scaleToWidth

* added simple tests
2017-09-28 23:25:20 -04:00
Stefan Hayden
0bb8a131a6 fixes problems with isTargetTransparent trageting. also nulls out cachedCanvas when not being used to make it easier to check if a proper cachedCanvas exists (#4356) 2017-09-28 22:28:08 -04:00
Andrea Bogazzi
cc7c36fa7d Added back target to object:modified (#4348)
* added back target

* Update canvas.class.js
2017-09-25 21:16:50 -04:00
Andrea Bogazzi
2c2111ebe3 Normalize selection events (#4340)
* different object managment
2017-09-25 15:14:15 -04:00
Andrea Bogazzi
dd6cbe93a2 Fix fast type in itext. (#4339)
* fix fast type
2017-09-23 00:39:20 +02:00
amadois
d7131d1cac corrected typo (#4328)
thanks
2017-09-20 19:27:03 +02:00
Andrea Bogazzi
ea93c288e8 fix-div-by0 (#4327) 2017-09-20 00:29:16 +02:00
Andrea Bogazzi
ad6521affb Paint order svg for CIRCLE, IMAGE and TEXT (#4320)
* added were missing
* added for image too
2017-09-18 00:14:08 +02:00
Stefan Hayden
0fc71349a6 Paint order (#4303)
* makes fabric aware of the paint-order svg2 spec to swap the paint order of stroke and fill
2017-09-17 22:47:35 +02:00
Andrea Bogazzi
ddb402730d Fix mouse:out on shift click selection (#4317)
* add hovered target when create active selection;

* selection and hovered

* added another assertion
2017-09-17 13:18:13 +02:00
Andrea Bogazzi
c03111824c Update deps (#4315)
* try replace tests
* modified tests for new qunit
* lint tests
2017-09-17 11:44:57 +02:00
Andrea Bogazzi
741fcbaa9a Fires selected for object included in drag area (#4314)
* added many tests
* linted tests
2017-09-16 23:31:11 +02:00
Andrea Bogazzi
9bd5e90840 Fix scale equally and double flip not happening (#4313)
* fix double flip

* fixed lint
2017-09-16 22:11:50 +02:00
Andrea Bogazzi
1b8786c706 Adding some tests on events firing (#4312)
* some tests on events

* fixed test linting
2017-09-16 20:27:45 +02:00
Andrea Bogazzi
87f4fc905b Add a new event and fixed the free drawing point displacement (#4311)
* things

* fixed drawing paths

* added jsdocs
2017-09-16 13:06:09 +02:00
Andrea Bogazzi
124da9ca26 backport subtarget fix 2017-09-09 00:29:10 +02:00
Andrea Bogazzi
0f265631b3 Compare distance between cursor with absolute value. (#4295)
* fix with Math.abs

* ok this works

* added test

* added test file

* linting tests

* wrong test
2017-09-07 12:59:02 +02:00
Andrea Bogazzi
545686ed96 Fix Safari svg whitespace (#4294)
* fix-whitespace

* fixed tests

* fixed doc
2017-09-07 12:02:56 +02:00
Andrea Bogazzi
0d36e565a9 improved docs, fixed dirty on group destroy (#4293) 2017-09-07 11:41:03 +02:00
Tristan Fischer
e2f44cc76b fix object.getObjectOpacity() docs (#4277) 2017-09-06 12:38:49 +02:00
Andrea Bogazzi
860b7a74c0 mousemove and svg export (#4283) 2017-09-06 12:38:12 +02:00
Andrea Bogazzi
a72d9630f6 try with mouseout (#4275) 2017-08-31 23:18:59 +02:00
Andrea Bogazzi
5bab9b84b2 fix path exports svgs (#4274) 2017-08-31 22:59:22 +02:00
Tristan Fischer
5f7e61f02f fix typo in shadow docs (#4271) 2017-08-31 22:33:10 +02:00
Andrea Bogazzi
4e438cac7b improved condition (#4258) 2017-08-29 22:35:02 +02:00
Andrea Bogazzi
db6510be67 adds , {backstoreOnly: true} for toDataURL export (#4254)
adds the backstoreOnly to __toDataURLWithMultiplier's setDimensions calls to prevent the canvas from resizing in the browser window when the canvas.toDataURL() method is called per issue #4252
2017-08-29 22:25:59 +02:00
Andrea Bogazzi
69d377b992 Output version (#4251)
* output version in json

* fixed tests

* fixed lint
2017-08-29 22:23:42 +02:00
Andrea Bogazzi
678099ed21 Fix free drawing, fix minScaleLimit for textbox (#4250)
* fixed free drawing
* better handling of minscale limit
2017-08-25 10:43:24 +02:00
Asturur
ffe49ccf9c pass activeObject to event 2017-08-19 23:39:24 +02:00
Andrea Bogazzi
a15d480d07 fix dataurl and improve docs for move forward/backward (#4229)
* fix dataurl and docs
* fixed paths
2017-08-18 21:29:06 +02:00
Andrea Bogazzi
16f5baaf29 Fix group canvas propagation to sub objects (#4228)
* restore canvas prop

* add tests

* add tests
2017-08-18 20:43:39 +02:00
ncou
b663204002 Better mouse support when lockScalingFlip is true. (#4225) 2017-08-18 15:55:31 +02:00
ncou
e9a5d0000e Fix unicode space char (#4224) 2017-08-18 14:25:52 +02:00
Andrea Bogazzi
9fc678825e fix shader pick (#4207) 2017-08-16 10:16:59 +02:00
Andrea Bogazzi
3b10702512 Normalize Api for getSelectionStyles, setSelectionStyles (#4202)
* reworked the text selection

* reorganized api

* missing file

* fixed lint

* more test
2017-08-15 10:10:01 +02:00
Andrea Bogazzi
6b4d215162 Remove active property from objects (#4200)
* removed active
* removed active property
* removed active property
2017-08-14 15:12:58 +02:00
Stefan Hayden
b114d8d0ee Parser RegEx update (#4003)
* better regex and attribute validation as well as public accesss to the regex

* lint
2017-08-14 13:52:52 +02:00
Andrea Bogazzi
b7d9047c9c Put window.fabric under a build flag (#4199)
* moved global in a module

* fix package.json
2017-08-14 13:42:17 +02:00
Andrea Bogazzi
a06b568968 Improved selection flow (#4198)
* improved flow
* improved selection flow
* do not transform not selected objects
2017-08-14 13:29:32 +02:00
Andrea Bogazzi
4cccab8f51 Remove fabric.Object.remove (#4197)
* removed remove method

* removed remove method
2017-08-14 09:44:51 +02:00
Andrea Bogazzi
77632c6e0e fixed svg import again (#4196) 2017-08-14 09:35:19 +02:00
Andrea Bogazzi
1c0c12fe8a fix-text-pattern (#4194) 2017-08-13 23:05:40 +02:00
Andrea Bogazzi
03efa1801a Fixed style removal for wrapped textbox (#4193)
* fixed style backspace
* use numeric value to compare
2017-08-13 21:39:45 +02:00
Andrea Bogazzi
ffd2d3254c Fix block style insertion (#4192)
* fix style nsertion

* fixed tests from older changes

* fixed tests from older changes
2017-08-13 20:49:39 +02:00
Asturur
836bf158b9 setAngle => rotate 2017-08-12 13:48:01 +02:00
Asturur
1fd1ba3b55 fix typo in isRendering 2017-08-10 00:12:34 +02:00
Andrea Bogazzi
39321c7b34 Fix text copy paste when there is no style (#4185)
* fix

* removed dist build
2017-08-09 23:17:07 +02:00
Nick Swider
da27ef57c4 Add chaining to iText selection methods (#4178) 2017-08-09 09:05:40 +02:00
Andrea Bogazzi
ddb9896455 fix opacity (#4176) 2017-08-06 17:56:45 +02:00
Andrea Bogazzi
59e615024c Hue filter (#4175)
* added hue rotation

* added hue rotation
2017-08-06 17:23:42 +02:00
Andrea Bogazzi
b5323bd83e make function just create canvas (#4172)
* make function just create canvas
* added tests
* added tests
2017-08-05 21:32:03 +02:00
Andrea Bogazzi
5a791a8291 fixed origins (#4170)
* fixed origins

* fixed origins
2017-08-04 11:20:50 +02:00
Asturur
acd941925a fix typo in shaders 2017-08-04 08:47:27 +02:00
Andrea Bogazzi
eec7981eec added onSelect (#4168) 2017-08-04 08:45:32 +02:00
Andrea Bogazzi
e0546b0105 Fix bugs with new activeSelection (#4167)
* test

* fixes
2017-08-04 00:11:00 +02:00
Andrea Bogazzi
068c815340 Fix text insert on null, give default style to text (#4166)
* text style error
* change text init
* fixes
2017-08-03 23:23:42 +02:00
Andrea Bogazzi
c705c6b4d8 Fix custom build (#4165)
* Update misc.js
* move the line in correct place
2017-08-03 22:14:17 +02:00
Asturur
f86370582c changes to build file 2017-07-29 16:28:30 +02:00
Andrea Bogazzi
7b50999f83 Fixes some beta issues (#4148)
* fixed the image.toSVG
* fixed the image.toSVG
* fixes
2017-07-29 14:09:31 +02:00
neopheus
3b06e685ef Some modifications (#4137)
* unnecessary semicolon
* comment error
* expression simplified
* simply function
* jsdoc update
2017-07-29 11:41:32 +02:00
neopheus
1ab140c830 centerPont => centerPoint (#4132) 2017-07-24 11:30:09 +02:00
neopheus
4df632b93f Update comments (#4128)
* Update Doc

* Update Doc - 2
2017-07-24 11:29:46 +02:00
neopheus
9965002e9f Add Color CSS3 (#4130)
* Update Color names CSS3 - https://www.w3.org/TR/css3-color/#svg-color

* reformat code

* reformat code - update
2017-07-24 11:28:57 +02:00
Andres
096a5d3214 Fixed typo in createImageData (#4121) 2017-07-22 20:56:19 +02:00
Andrea Bogazzi
351e7dfa47 Multiple fixes (#4119)
* multiple fixes
* updated tests
2017-07-22 16:34:47 +02:00
Andrea Bogazzi
c9b562de9e Remove activeGroup functionalities from Group, create ActiveSelection class (#4076) 2017-07-22 11:37:17 +02:00
Stefan Hayden
91376732ac bugfix for group.fromObject (#4111) 2017-07-22 01:23:28 +02:00
Andrea Bogazzi
5367cfa8e3 Add tests for sourcePath changes (#4108)
* modified path
* added tests
2017-07-18 08:38:19 +02:00
Justin Parker
6702fe6dc6 Use generic setter for sourcePath (#4093) 2017-07-15 13:37:36 +02:00
0s1r1s
b06d4ed785 Add missing double quotes (#4096)
The 'width' attribute didn't close inside toSvg function
2017-07-15 13:34:14 +02:00
Andrea Bogazzi
392e21312b introduce break test (#4102) 2017-07-15 13:21:59 +02:00
Justin Parker
0547bdf656 Font cache: no lower case of fontWeight (#4097)
* Font cache: no lower case of fontWeight
2017-07-15 12:29:20 +02:00
Scott Seaward
a06ea03451 Improve performance of copyGLTo2D in Firefox & potentially other browsers (#4086)
Why:

* When filtering with webgl copying data to 2d canvas from GL context dominates the filtering time
* Chrome is happy to copy data from GL with ctx.drawImage in sub-millisecond time
* Firefox performs drawImage much more slowly but can do putImageData fast instead
* Using putImageData results in ~ 2-3x speedup on Firefox 54 in the fabricjs.com filtering demo on my MacbookPro

This change addresses the need by:

* Adding a runtime check for which copy func is better performing
* Swapping drawImage for putImageData if that func is detected as being faster

Also submitted for review:

* Log minifier error output to console if build.js minifyCmd fails (helps identify syntax errors while using build:watch)
2017-07-12 22:28:40 +02:00
Andrea Bogazzi
fd0665b434 Update canvas.class.js 2017-07-07 15:29:13 +02:00