Commit Graph

1027 Commits (646a927ef69f488a92c862ba1cc4237e21a12ea5)

Author SHA1 Message Date
codedread 4043c6e537 Change all tab indentations to 2sp indentation. Addresses issue #37 2018-05-17 21:02:30 -07:00
Neil Fraser 7bb89f53a5 Don’t throw error for unlinked nodes in Chrome
evt.target in Chrome is the abandoned shape, not connected to the DOM.  evt.target in Firefox is the svgroot.

Add checks to ensure that no matter what node is presented by the event, there are no property calls to null or undefined.

Fixes issue #232.
2018-05-17 12:04:58 -07:00
Neil Fraser f9fb7f47ae Residual linting
{object} -> {Object}
Remove extra semicolons.
Use jQuery’s .empty().
Make nodelist loops O(n) rather than O(n^2).
Specify radix in parseInt to prevent guessing octal.
2018-05-17 11:57:28 -07:00
Brett Zamir fb329e4977
Merge pull request #229 from NeilFraser/deps
Add missing dependency
2018-05-17 15:32:20 +08:00
Brett Zamir 25b1e9be01 - Linting (ESLint): Fix other indents besides main (though continue to disable check) 2018-05-17 13:15:20 +08:00
Brett Zamir a3b3525789 - Linting (ESLint): Finish
- Fix: Globals (x, y) in `mouseMove`
- Fix: Global (element, d_attr->dAttr) in `mouseDown`
- Fix: Avoid `drawnPath` not defined error
- Docs: sp.
2018-05-17 11:34:21 +08:00
Brett Zamir 340915be4e - Linting (ESLint): Finish extensions and most files in editor/; unfinished: `editor/svg-editor.js`, `editor/svgcanvas.js`
- Linting (ESLint): Fix ignore file paths
- History `elem` fix
2018-05-16 12:08:41 +08:00
Neil Fraser 6aced017ea Add missing dependency
HistoryRecordingService is required at line 400.
2018-05-10 12:07:44 -07:00
Igin edb8a75402 fix #222 Browsers block data URI (#224)
* fix #222 Browsers block data URI

* add spaces and blank lines
2018-04-12 11:00:52 -07:00
Jeff Schiller 396cce40eb
Merge pull request #208 from iuyiuy/setSvgString_without_undo
Add ability to set the svg drawing without adding to the undo stack.
2018-02-27 07:04:09 -08:00
KB Jørgensen 64759a8cab Added documentation for the preventUndo parameter in the svgcanvas.setSvgString() function. 2018-02-27 11:21:07 +01:00
KB Jørgensen d3ed6cbb8c Changed code style as requested in svgedit pull request #208. 2018-01-26 15:11:41 +01:00
KB Jørgensen 07803fd1db Add ability to set the svg drawing without adding to the undo stack. 2018-01-22 11:40:00 +01:00
KB Jørgensen 42bcd5bcf8 Fixed typo in comment. 2018-01-22 10:15:59 +01:00
KB Jørgensen 02c8721c2d Implemented a clipboard that works across tabs and windows. 2018-01-18 14:02:03 +01:00
Jeff Schiller 97f5127e81 Merge pull request #130 from iuyiuy/addSvgElementFromJson_expansion
Add svg element from json expansion
2016-11-15 05:57:26 -08:00
KB Jørgensen b92024eca2 Adjusted requested code styling changes. 2016-11-15 09:27:31 +01:00
Jeff Schiller f7a1d2eb81 Merge pull request #148 from iuyiuy/optimized_loading
Optimized loading by removing unnecessary code
2016-11-14 08:17:10 -08:00
KB Jørgensen c65f98b0ba Split code for added clarity. 2016-11-14 10:08:06 +01:00
KB Jørgensen 4994deb6ec Removed redundant function name. 2016-11-14 10:06:05 +01:00
KB Jørgensen 0bf50b0b42 Added description of the new children option to the addSvgElementFromJson() function. 2016-11-14 09:54:53 +01:00
Jeff Schiller 627d038e33 Merge pull request #142 from iuyiuy/null_stroke_fix
Fixed an issue where resizing an element would set stroke="null" on it.
2016-11-11 10:09:06 -08:00
Jeff Schiller 8f73ae16bb Update svgcanvas.js 2016-11-11 10:08:38 -08:00
KB Jørgensen 6f2822fac8 Removed code which went through all nodes and recalculated dimensions,
which was a lot of work for large svg drawings. There's no need to do
that when loading. It will happen gradually when you use it and on
manageable parts. This changed the loading time for a page with svg-edit
and a large drawing from ~50 secs to ~5 secs.
2016-11-11 15:46:51 +01:00
KB Jørgensen b2469d27d5 Fixed an issue where resizing an element would set stroke="null" on it. 2016-10-12 10:37:50 +02:00
Simon Brown b9549e1d43 fixed call to createSVGRect in getIntersectionList
createSVGRect() does not have parameters, they must be set on the object after

https://developer.mozilla.org/en/docs/Web/API/SVGSVGElement
2016-09-14 18:44:09 +01:00
KB Jørgensen e79db0f2a6 Added ability to create a text node with just a string in addSvgElementFromJson(). 2016-08-08 16:32:59 +02:00
KB Jørgensen b301acf716 Added ability to include children in the json to addSvgElementFromJson(). 2016-08-05 14:29:58 +02:00
Flint O'Brien 6023bd6f5a Formatting changes. 2016-05-04 09:54:20 -04:00
Flint O'Brien 87e25e9d2c Fix merge/cloneLayer. Migrate more Canvas functions to Draw. Tests.
Fixed recently introduced bugs in mergeLayer, cloneLayer.
More Draw unit tests.
Migrating Canvas methods to Draw, Layer, and utilities: copyElem,
pathActions.convertPath, cloneLayer, mergeLayer, and mergeAllLayers.
Canvas API is unchanged for backwards compatibility (i.e. previous
functions forward to new functions).
2016-05-04 09:38:29 -04:00
Flint O'Brien 2799b4cba2 Test and fix current layer rename. 2016-05-02 18:33:45 -04:00
Flint O'Brien 899853c963 Fixed Layers in svgcanvas. Moved Layer class. New HistoryRecordingservice.
Canvas was referencing drawing.all_layers and drawing.current_layer.
Both variables now represent Layer instead of group element and should
be considered private.
Moved Layer class to layer.js
New HistoryRecordingService added to help with moving Layer code out of
Canvas. Started using it in Canvas.mergLayer
2016-05-01 22:58:41 -04:00
Flint O'Brien 7db3b22c58 Updates from pull request code review. Refactored getExtraAttributesForConvertToPath.
Updated all formatting requests.
Refactored and renamed addAttributesForConvertToPath to
getExtraAttributesForConvertToPath. Now called from
getBBoxOfElementAsPath and convertToPath.
2016-04-26 16:01:39 -04:00
Flint O'Brien 17c3e0fa28 Performance improvement for select.js and canvas.addToSelection
canvas.addToSelection was calling getBBox, throwing it away, then
calling selectorManager.requestSelector() which called getBBox again.
Now passing-in an optional bbox to selector functions.
2016-04-24 16:56:32 -04:00
Flint O'Brien 12a393505d Refactoring and performance improvements for getStrokedBBox.
canvas.getStrokedBBox internals refactored to svgutils.
getStrokedBBox/getCheckedBBox renamed to
svgedit.utilities.getBBoxWithTransform
Removed duplicate calls to native getBBox.
Refactored slow transformed BBox from temporary DOM append/remove to
matrix calculations.
Lots of tests. Added qunit/qunit-assert-close.js.
2016-04-24 16:43:20 -04:00
Flint O'Brien 01ad9d7fdd Refactor canvas.convertToPath() internals to svgutils in preparation for getBBox performance improvements.
Two new functions in svgutils: convertToPath() and getBBoxOfElementAsPath().
Updated test/svgutils_test.html.
2016-04-22 12:24:52 -04:00
Jeff Schiller a3dbb7c5af Merge pull request #91 from magnebra/add_text_config_options
Add config options for text
2016-03-19 22:35:11 -07:00
Magne Bratseth 1f57536546 Add config options for text 2016-03-15 08:43:24 +01:00
Philip Rogers 9d7e60933b Merge pull request #90 from magnebra/missing_defs_after_paste
Check for deleted defs after paste, fixes #82
2016-03-14 23:55:54 -07:00
Magne Bratseth a41191158f Check for deleted defs after paste, fixes #82 2016-03-14 13:16:30 +01:00
Ian Newborn d8dae76d3a Exposed grid snapping setting on svgCanvas 2016-03-14 09:13:56 +00:00
Jeff Schiller e625a2b434 Merge pull request #67 from magnebra/getintersectionlist_fails_ie_chrome
some browsers require objects passed to getInsectionList to be of correct the type
2016-02-20 19:38:32 -08:00
Jeff Schiller e26c7cd759 Merge pull request #57 from StalderT/patch-3
Update svgcanvas.js
2016-02-14 21:32:38 -08:00
Magne Bratseth 88ef7b02cc It seems some browsers require objects passed to getInsectionList to
actually be of the correct type
2016-02-10 09:38:43 +01:00
Jeff Schiller 6715e62146 Merge pull request #7 from ibrierley/master
Fix for import svg image leading to unattached dragtool
2016-01-31 23:27:01 -08:00
StalderT ae533338a1 Update svgcanvas.js
correct https://github.com/SVG-Edit/svgedit/issues/54
2016-01-16 19:42:15 +01:00
StalderT 5a5347045c Update svgcanvas.js
correct https://github.com/SVG-Edit/svgedit/issues/55
2016-01-16 19:40:29 +01:00
Jeff Schiller c6255aaceb Update home page links to github 2015-12-03 00:24:28 -08:00
Jeff Schiller 3f0db99c6c Use SVGElement.getIntersectionList() for multiselect. Remove some try-catch statements 2015-11-30 19:08:13 -08:00
Jeff Schiller 59303eb6cc Remove all suspendRedraws 2015-11-30 18:59:53 -08:00