Jürg Lehni
7241edd98a
Implement a more refined strategy to handle 'contour' segment in unite boolean operations.
...
Improvement for the fix in 648beb33e9
for #1054 , solves the issues described in https://github.com/paperjs/paper.js/issues/1054#issuecomment-225356983
2016-06-13 11:58:18 +02:00
Jürg Lehni
34c35e26bd
Switch to sampling only one location for winding contribution.
...
Closes #1073
2016-06-13 11:26:02 +02:00
Jürg Lehni
4c94553b81
Minor cleanup.
2016-06-13 09:00:29 +02:00
Jürg Lehni
fc600595a4
Implement improved strategy to handle tangents in CurveLocation#isCrossing()
...
Relates to #1074
2016-06-13 08:56:45 +02:00
Jürg Lehni
4966f6250f
Implement better calculation of tangential angles in CurveLocation#isCrossing()
...
Relates to #1074
2016-06-12 18:53:14 +02:00
Jürg Lehni
5854c25dd5
Implement Curve#getOffsetAtTime()
2016-06-12 18:32:05 +02:00
Jürg Lehni
b0d0e41ddc
Allow negative offsets in all Curve#get*At() methods.
...
To search from the end of the curve instead of the beginning.
2016-06-12 18:21:37 +02:00
Jürg Lehni
7404485f96
Simplify isInRange() check a bit.
...
No need to check against ±180 as that condition will always be met.
2016-06-12 17:43:10 +02:00
Jürg Lehni
614c781f29
Put the recursion cap back into fat-line clipping code.
...
But use a higher value, and have it work in conjunction with call-count cap.
Relates to #1074
2016-06-12 17:07:43 +02:00
Jürg Lehni
452bbfdaa4
Add unit tests and change-log entry for #904
...
Closes #904
2016-06-11 13:13:08 +02:00
Jürg Lehni
d1f1d7a5f6
Change behavior of PathItem#closePath() to always attempt joining segments.
...
Add optional tolerance argument, and use it to handle SVG imprecisions.
Closes #1045
2016-06-11 12:43:37 +02:00
Jürg Lehni
de8b626033
Add tolerance argument to Path#join(path, tolerance)
2016-06-11 12:41:23 +02:00
Jürg Lehni
68be3f102e
Prevent mousedown events from disturbing mousenter / mouseleave.
...
Closes #1069
2016-06-11 11:14:19 +02:00
Jürg Lehni
41e4c622a3
Improve fat-line clipping for rare edge cases.
...
Instead of limiting recursion levels, limit actual call count. Relates to #904
2016-06-10 23:51:56 +02:00
Jürg Lehni
715025725d
Improve handling of SymbolItem bounds with #applyMatrix = false.
...
Closes #1070
2016-06-10 21:32:22 +02:00
Jürg Lehni
ed3e283802
Fix Item#importJSON() to preserve #parent on existing, already inserted items.
...
Closes #1041
2016-06-10 17:45:02 +02:00
Jürg Lehni
e7f7d7c5d1
Fix jshint error caused by #1065
2016-06-10 17:28:46 +02:00
Jürg Lehni
2c2542fb2f
Remove unique IDs from Color objects.
2016-06-10 16:19:59 +02:00
Jürg Lehni
0d2779dfc5
Docs: Define default value for PathItem#flatten()
...
And some other minor cleanups.
2016-06-10 14:53:52 +02:00
Jürg Lehni
964d8cf7d6
PaperScript: Only translate == to equals() calls for Point, Size and Color.
...
Closes #1043
2016-06-10 13:41:36 +02:00
Jürg Lehni
648beb33e9
Take type of boolean operation into account in getWinding()
...
Relates to #1054
2016-06-10 13:04:57 +02:00
Jürg Lehni
803dfb6bb1
Improve reliability of Curve#isStraight()
...
Closes #1066
2016-06-10 12:33:44 +02:00
Jürg Lehni
1f4e4f2f60
Implement boolean simplification suggested by @iconexperiene
...
See https://github.com/paperjs/paper.js/issues/1054#issuecomment-222517963
2016-06-10 12:06:08 +02:00
Jürg Lehni
719392dd2c
Merge pull request #1060 from iconexperience/patch-3
...
Check for prevTime >= tMin and prevTime <= tMax
2016-06-10 12:00:23 +02:00
Jan
e564955501
Correclty implement sorting of intercepts
...
`Array.sort()` without comparison function does not sort by numeric value, but by unicode characters (103 comes before 93 by this sorting), therefore a simple comparison function is required.
2016-06-07 16:44:42 +02:00
Jan
b735a3ec95
Fix getInteriorPoint()
...
getInteriorPoint() could return a point outside the path as explained in #1064
This fix excludes curve's start points from intercept detection to prevent double counting, it ensures that all intercepts are collected and the intercepts are sorted by x-value.
2016-06-07 16:11:37 +02:00
Jan
9f93f6ee78
Check for prevTime >= tMin and prevTime <= tMax
...
Parameter scaling should only be done if the curve was actually split previously. This only happened if prevTime greater tMin and less tMax.
2016-06-01 14:38:44 +02:00
Jürg Lehni
f19d0c8134
Rename GradientStop#rampPoint to #offset
2016-05-31 12:35:44 +02:00
Jürg Lehni
f07927a95e
Correctly handle { x: 0, y: 0 } in Raster#getAverageColor()
...
Closes #1053
2016-05-27 11:42:08 +02:00
Jürg Lehni
9aa29e0afc
Add support for construction from strings to Point and Size.
2016-05-27 11:37:19 +02:00
Jürg Lehni
fefb4302e8
Improve Item#_getStrokeMatrix()
2016-05-22 21:23:46 +02:00
Jürg Lehni
948a8af9a8
Fix Item#strokeBounds with #strokeScaling and #applyMatrix
...
Closes #1014
2016-05-22 21:17:24 +02:00
Jürg Lehni
be79a0e504
Cleanup Path#flatten() code.
2016-05-22 17:24:12 +02:00
sapics
78498f4fd5
Add last curve segment point in path.flatten
2016-05-06 13:28:27 +09:00
Jürg Lehni
681d5537b3
Always pass on dictionary object in _serialize()
...
It is used to determine if ojects can be serialized in compact form.
2016-05-04 18:06:18 -07:00
Jürg Lehni
4f65996d34
Fix #1032 : Correctly handle lastPoint in first mousemove.
...
Improve first attempt of a fix in e054b760ed
2016-04-13 15:52:59 -07:00
Jürg Lehni
e0a0cd58d5
PaperScript: Improve tool detection code.
...
And implement Multiple Tools example.
2016-04-13 15:21:35 -07:00
Jürg Lehni
d8d61ff160
Fix #1015 : Improve handling of already inserted children in#insertChildren()
2016-04-13 13:36:26 -07:00
Jürg Lehni
345730f634
Merge pull request #1002 from sapics/curve-divide
...
Call curve._changed at curve.divideAtTime
2016-04-06 20:24:55 -07:00
Jürg Lehni
ff82e43d2f
Fix GradientStop support in SVG export.
...
Closes #1027
2016-04-06 20:17:13 -07:00
Jürg Lehni
84421abbce
Set crossOrigin before src on image objects.
...
Reason: https://bugs.chromium.org/p/chromium/issues/detail?id=341047
2016-04-05 12:25:24 -07:00
Jürg Lehni
5a9f3dfb27
Improve handling of local paths and CORS on Node.js
2016-04-05 12:11:54 -07:00
Jürg Lehni
093227be7e
Fix leaked global variable.
2016-04-04 23:38:37 -07:00
Jürg Lehni
ae9ff56260
Improve check for local URLs in paper.resolvePath()
2016-04-04 23:30:53 -07:00
Jürg Lehni
7cf844886f
Add support for relative (local) URLs on Node.js
2016-04-04 23:26:43 -07:00
Jürg Lehni
f4e4e7ab9c
Switch to jsdom v8.3.0, now that it includes our node-canvas PR.
...
See https://github.com/tmpvar/jsdom/pull/1366
2016-04-04 17:55:43 -07:00
Jürg Lehni
20fc3b9f0f
Optimize Curve.getArea() to use less operators.
...
As proposed by @iconexperience in https://github.com/paperjs/paper.js/issues/994#issuecomment-189946135 , rearranged for mathematical symmetry.
Closes #994
2016-03-28 08:17:27 -07:00
Jürg Lehni
fc03e042f9
Some minor code and comment cleanup.
2016-03-28 07:59:55 -07:00
Jürg Lehni
e054b760ed
Fix cases where toolPoint was null.
2016-03-27 21:41:22 -07:00
Jürg Lehni
1a0c15f177
Fix #1021 : use Item#getStyle() to use correct parent style in CompoundPath bounds calculations.
2016-03-27 13:39:30 -07:00
Jürg Lehni
3b71de9544
Fix #980 : Implement visual selection of item.position
2016-03-17 14:15:28 +01:00
Jürg Lehni
00b2102b6d
More clean-up of selection handling refactoring.
2016-03-17 13:36:02 +01:00
Jürg Lehni
336bc1092e
Replace Item#_boundsSelected with #_selectBounds
...
Plus some refactoring.
2016-03-17 13:09:02 +01:00
Jürg Lehni
f0edcd31b0
Fix #769 : Implement Item#selection flags to separate selection from item and bounds.
2016-03-17 13:02:26 +01:00
Jürg Lehni
f7bb96e8b9
Fix #1000 : Improve calculation of length of straight curves.
...
Support sub-ranges now too, through Curve.subdivide()
2016-03-17 11:24:20 +01:00
Jürg Lehni
6cd36f5460
Fix #1001 : Convert absolute local gradient URLs back to relative ones.
2016-03-17 09:48:43 +01:00
Jürg Lehni
d93aca6b5c
Refactor GradientStop: Improve handling of optionally defined color and rampPoint.
...
Relates to https://github.com/paperjs/paper.js/issues/1001#issuecomment-197557990
2016-03-17 09:38:42 +01:00
Jürg Lehni
0e658da104
SVG Import: Improve style inheritance in nested <defs>
2016-03-16 20:47:57 +01:00
Jürg Lehni
ca76c1d24f
Fix #1009 : Make sure all name lookup structures are kept in sync for layers too.
2016-03-16 09:56:10 +01:00
Jürg Lehni
84d2a2f908
SVG Import: Fix issues with viewBox.
2016-03-15 19:00:35 +01:00
Jürg Lehni
484d696df3
Fix #1008 : Remove use of ActiveXObject in Http.request()
2016-03-14 19:40:46 +01:00
Jürg Lehni
da7d0d8f75
Implement Path#splitAt(offset)
...
Also make sure the deprecated Path#split(offset) works as it used to. Relates to #563
2016-03-14 18:59:09 +01:00
Jürg Lehni
af1c481523
Correctly handle trailing slashes in XML attribute namespaces.
...
See #984
2016-03-14 18:31:45 +01:00
sapics
60f1e78889
Call curve._changed at curve.divideAtTime
2016-03-05 12:23:02 +09:00
Jürg Lehni
7dd110f5b2
Simplify Path#getArea()
...
Relates to #994
2016-02-26 17:49:44 +01:00
Jürg Lehni
1db419a87b
Rename SegmentSelection related internal objects and properties.
...
Relates to #769 , #980
2016-02-26 16:31:50 +01:00
Jürg Lehni
08bf7bfe60
Fix #995 : Improve handling of event propagation on View and Item.
2016-02-26 15:13:49 +01:00
Jürg Lehni
69c34707e7
fix #994 : Revert commit b5af47a7b1
...
Revert back to correct implementation of Path#getArea() and implement unit tests for it.
2016-02-26 12:58:50 +01:00
Jürg Lehni
9f90659fdb
Fix #991 : Make sure items get fully removed in removeChildren()
2016-02-23 11:59:59 +01:00
Jürg Lehni
50bd5bee6f
SVG: Add comments explaining IE related changes in #984
2016-02-20 00:19:36 +01:00
Jürg Lehni
acb1e408d0
SVG Import: Fix namespacing issues introduced by #984
2016-02-19 23:30:54 +01:00
Jürg Lehni
b71e3a44d9
Fix #981 : Make sure event.delta is always calculated correctly.
...
The first mousemove / mousedrag events wrongly received the delta from the last mouseup event.
2016-02-19 13:49:06 +01:00
aschmi
49104c5cf0
Add trailing slashes to svg related namespaces (xmlns, xlink)
2016-02-18 16:08:12 +01:00
aschmi
a4757b37de
Extend mapping of attribute names to required namespaces
2016-02-18 16:07:56 +01:00
Jürg Lehni
b5c837bb87
Fix #982 : Make sure self
points to the global scope on Webpack.
2016-02-17 19:06:29 +01:00
Jürg Lehni
6df4602b2b
Fix #977 : Implement unit-tests.
2016-02-16 20:52:07 +01:00
Jürg Lehni
4081afb635
Fix #977 : Apply hit-testing tolerance to fills in Shape.
2016-02-16 00:28:04 +01:00
Jürg Lehni
6975690824
SVG Export: Do not filter out empty paths.
2016-02-16 00:06:26 +01:00
Jürg Lehni
7f48486163
Merge pull request #976 from iconexperience/patch-2
...
Fix #974 - Keep empty clip mask in SVG export
2016-02-16 00:01:36 +01:00
Jürg Lehni
c35814f94f
Node.js: Fix bug when using paper-core.js
...
And improve Node.js examples. Closes #975
2016-02-15 23:59:31 +01:00
Jürg Lehni
16a7baa967
SvgImport: Fix issues introduced in 6f4890c63c
2016-02-15 23:58:40 +01:00
Jan
b5b1aa57d7
Keep empty clip mask in SVG export
...
A path should be exported in SVG if it serves as a clip mask, otherwise all items in the clip group that were hidden by clipping in paper.js become visible in the SVG.
2016-02-15 15:29:19 +01:00
Jürg Lehni
3d330da4fc
Fix failing unit tests.
2016-02-15 09:21:11 +01:00
Jürg Lehni
08e51b5ca4
Fix failing SVG unit test.
2016-02-15 08:42:59 +01:00
Jürg Lehni
6f4890c63c
Implement new options to control bounding box in SVG Export
...
And use it to support SvgExport unit tests. Relates to #972
2016-02-15 00:13:38 +01:00
Jürg Lehni
21033f7850
Implement PathItem.create(pathData)
...
determining if the data describes a plain path or a compound-path with multiple sub-paths.
2016-02-14 23:16:22 +01:00
Jürg Lehni
9f9222f416
List all supported events in event methods on View.
2016-02-14 23:04:48 +01:00
Jürg Lehni
3c3c8d98b0
Document options.insert in #importSVG()
2016-02-14 22:54:33 +01:00
Jürg Lehni
dba4eb371d
SvgImport: Implement options.insert to control insertion.
...
Also use settings.insertItems for faster import. Closes #763
2016-02-14 22:51:50 +01:00
Jürg Lehni
8d5c922c50
Simplify code from #971 and activate unit test for it again.
2016-02-14 22:15:55 +01:00
Jürg Lehni
4c72d9866f
Merge pull request #971 from iconexperience/fix-issue-968
...
Fix for #968 - Improve handling of points on paths in getWinding()
2016-02-14 22:06:55 +01:00
Jürg Lehni
55e7689186
Fix regression introduced in 4e7fa2f04e
2016-02-14 21:55:26 +01:00
Jan
406e6c95b9
Adjust comments to match new implementation
2016-02-14 21:44:34 +01:00
Jürg Lehni
4e7fa2f04e
Implement PaperScope#settings.insertItems
...
Controlling whether newly created items are automatically inserted into the scene graph.
2016-02-14 21:34:35 +01:00
iconexperience
e2eaf87fcb
Improve handling of points on paths in getWinding()
2016-02-14 20:57:24 +01:00
Jürg Lehni
56dd636f22
JSON: Improve serialization and deserialization on objects other than Item.
...
Closes #392
2016-02-14 17:16:40 +01:00
Jürg Lehni
75c40babc9
SvgImport: Implement support for onLoad and onError callbacks on string input.
...
Closes #827
2016-02-14 15:12:52 +01:00
Jürg Lehni
2025bd1a77
SvgImport: Implement onError() callback
...
Closes #969
2016-02-14 14:52:37 +01:00
Jürg Lehni
79d446136a
Clean up PR #931
...
Closes #930
2016-02-14 14:15:17 +01:00
Jürg Lehni
9c9f40d05a
Merge pull request #931 from sapics/path-arc
...
Fix path.arcTo error
2016-02-14 14:11:52 +01:00
Evgeniy Malyarov
add28666cf
Update Path.js
...
fix getNearestPoint error on uninserted curves
; Conflicts:
; src/path/Path.js
2016-02-14 14:03:54 +01:00
Evgeniy Malyarov
fb76065242
Update Curve.js
...
fix getNearestPoint error on uninserted curves
2016-02-14 14:03:00 +01:00
Jürg Lehni
e6f43da22b
Fix various issues with scaling of shadows.
...
Supports browser-zoom, HiDPI canvas and view zoom.
Closes #831
2016-02-14 13:49:40 +01:00
Jürg Lehni
fa6c1f47b4
Hit-Test: Pass viewMatrix as argument instead of in options object.
2016-02-14 13:34:35 +01:00
Jürg Lehni
4a947317fb
Implement #hitTestAll() on Item and Project
...
Along with unit tests and documentation.
Closes #536
2016-02-14 12:39:35 +01:00
Jürg Lehni
3ee46ffc5c
Matrix: Switch to a better implementation of #decompose()
...
This now also correctly handles skewing in SVG export.
2016-02-14 10:59:57 +01:00
Jürg Lehni
e35a55fe66
Flip Matrix properties #b and#c
...
Their definition was reversed from almost all other Matrix implementations I've encountered.
2016-02-14 10:53:10 +01:00
Jürg Lehni
40d0fca9d0
Fix issue with item bounds permanently collapsing to 0 when applying non-invertible transformations.
...
We have to keep a backup of the last invertible state around.
Fixes #558 rather elegantly.
2016-02-14 10:44:41 +01:00
Jürg Lehni
dbd7a90e23
Better detect code that requires a tool object.
...
Closes #967
2016-02-14 01:45:16 +01:00
Jürg Lehni
27197bd156
Docs: Fix warning about isFlatEnough()
2016-02-13 23:32:29 +01:00
Jürg Lehni
0a6efe10f5
Give Tool a paperscript example.
...
Closes #967
2016-02-13 23:31:54 +01:00
Jürg Lehni
c3fff9fa83
Switch from new Base() to Base.set({}) where possible.
2016-02-13 23:10:09 +01:00
Jürg Lehni
009761d13c
Boolean: Only compare segments when determining if paths are identitcal.
2016-02-13 22:58:42 +01:00
Jürg Lehni
3348fb736f
Boolean: Implement proper handling of fully overlapping (identical) paths and sub-paths.
...
Closes #923 , closes #958
2016-02-13 22:41:09 +01:00
Jürg Lehni
0a196daa21
Clean-up previous commit.
2016-02-12 21:23:47 +01:00
Jürg Lehni
c6bcf4351a
Implement consistent checks for fill / stroke / shadow styles in test functions on Style class.
...
And use them in Item#_setStyles()
2016-02-12 21:22:30 +01:00
Jürg Lehni
e38829eb96
Support drawing shadows with no shadowBlur.
...
Closes #955
2016-02-12 21:05:05 +01:00
Jürg Lehni
84a75e375a
Remove unnecessary edge-case handling in CurveLocation#isCrossing()
...
Closes #951 , closes #959
2016-02-12 20:52:19 +01:00
Jürg Lehni
e2bc83af5d
Add test for #960 and improve fix a bit.
...
Closes #960
2016-02-12 20:19:40 +01:00
Jürg Lehni
7c24fc916f
Merge pull request #962 from iconexperience/fix-issue-960
...
Fix for #960 - Shortcut Curve.evaluate() for t === 1
2016-02-12 20:10:21 +01:00
Jürg Lehni
6d5d1ce077
Introduce Base.filter(), to copy and filter object properties.
2016-02-12 19:58:32 +01:00
Jürg Lehni
06d6b5195b
Do not cancel mousedrag events on stopPropagation()
...
Use preventDefault() instead.
Closes #952
2016-02-12 19:01:34 +01:00
Jürg Lehni
12f829c107
Part 2 of large refactoring of bounds handling.
2016-02-12 18:54:06 +01:00
Jürg Lehni
55c5f42716
Part 1 of large refactoring of bounds handling.
2016-02-12 17:59:37 +01:00
iconexperience
aa1f2196c9
Shortcut Curve.evaluate() for t === 1 to avoid imprecision.
2016-02-12 14:41:21 +01:00
Jürg Lehni
6797d2eb11
Respect clip-items in Group#_getBounds()
...
Closes #956
2016-02-11 12:51:04 +01:00
Jürg Lehni
68c4541844
SvgImport: Always create a clip-item when viewBox is specified.
2016-02-11 12:50:08 +01:00
Jürg Lehni
e38a33fd64
SVGImport: Inherit default styles on Node.js too.
2016-02-11 11:20:32 +01:00
Jürg Lehni
df57c4adb9
SVGImport: Improve consistency of style handling.
2016-02-11 11:06:09 +01:00
Jürg Lehni
d9e09b9d20
SVGImport: Further improve handling of gradients
...
- Respect radial setting when reusing graident definition
- Clean-up percentage handling
2016-02-10 18:23:56 +01:00
Jürg Lehni
c1b7366249
Improve fix for #650
...
Add support for multiple use of same gradient.
2016-02-10 18:13:13 +01:00
Jürg Lehni
fce126959d
SVGImport: Implement support for gradientUnits="objectBoundingBox"
...
Relates to #650 , but still needs unit tests.
2016-02-10 17:46:39 +01:00
Jürg Lehni
98fc51319f
Remove unnecessary double-spaces.
2016-02-10 16:15:35 +01:00
Jürg Lehni
56d5b3b323
SVGImport: Implement support for dimensions in percentage.
...
Closes #954
2016-02-10 16:14:51 +01:00
Jürg Lehni
adc5b86d2e
SVGExport: Remove unnecessary calls to Point#transform() in exportGradient()
2016-02-10 15:34:22 +01:00
Jürg Lehni
9e8fcee8cd
Change implementation of PathItem#flatten(flatness)
...
- flatness parameter specifies maximum allowed error instead of maximum allowed distance between point
- Parts that are already flat are not further flattened
- Corners are preserved
Closes #618
2016-02-10 14:58:40 +01:00
Jürg Lehni
00d2e2a5bb
Some CurveLocation cleanup.
...
- Remove UID as there is no need anymore
- Rename some private properties
2016-02-10 12:36:39 +01:00
Jürg Lehni
0ae232e4ab
Implement support for clip-masks in hit-testing.
...
Closes #671
2016-02-09 17:02:03 +01:00
Jürg Lehni
740c94e367
Implement Item#_hitTestChildren()
...
As suggested by @iconexperience in #671
2016-02-09 16:52:55 +01:00
Jürg Lehni
bd7f3554d8
Fix options handling in Item#clone() to keep backward compatibility.
2016-02-09 16:11:38 +01:00
Jürg Lehni
e179b08156
Implement Item#clone(options) with support for options.deep
...
Closes #941
2016-02-09 16:01:06 +01:00
Jürg Lehni
21723ca6ca
Improve documentation of PostScript-style drawing commands.
2016-02-09 15:09:39 +01:00
Jürg Lehni
717bc4bc79
Implement PathItem#getNearestLocation() / #getNearestPoint()
...
Closes #727
2016-02-09 14:34:21 +01:00
Jürg Lehni
a48d13878a
Fix JSDoc warning on Style class.
2016-02-09 14:15:55 +01:00
Jürg Lehni
3965dd9b77
Implement CompoundPath#flatten(), #simplify(), #smooth()
...
And improve documentation for PathItem#simplify().
Closes #920
Relates to #727
2016-02-09 14:13:30 +01:00
Jürg Lehni
c793538841
No need to pass normalized tangents to PathFitter#fitCubic()
...
The get normalized and scaled anyway.
2016-02-09 14:11:23 +01:00
Jürg Lehni
e5d139ca11
Clean-up PathFitter code.
2016-02-09 14:09:53 +01:00
Jürg Lehni
d1b11c6ea9
Rearrange method sequence in Path.
2016-02-09 12:47:37 +01:00
Jürg Lehni
de9653ab45
Fix new exception in unit tests.
2016-02-09 10:07:28 +01:00
Jürg Lehni
da216aa581
Improve handling of view updates and detection of invisible documents.
...
Switch to the new HTML5 Page Visibility API.
2016-02-09 09:59:19 +01:00
Jürg Lehni
0371f66bda
Do not snap curve points to t = 0 / 1 with epsilon
...
Closes #936 . Also:
- Reduce CLIPPING_EPSILON to 1e-9 to fix errors that were masked by the snapping
- Implement unit tests for edge cases in #936
2016-02-06 15:12:35 +01:00
Jürg Lehni
ffe42a0220
Some comment cleanup.
2016-02-05 20:31:58 +01:00
Jürg Lehni
5a46620768
Merge branch 'winding-fix' into develop
...
; Conflicts:
; src/path/PathItem.Boolean.js
2016-02-05 20:25:25 +01:00
Jürg Lehni
55909b8bd5
Some code cleanup for winding-fix.
2016-02-05 19:43:48 +01:00
iconexperience
5b31aee8bb
Change the implementation of getWinding() again, so we pass all tests. This new version does not count any intersections if the point is on a y-monotonic curve, but at the final calculation it sets the winding to at least 1 if the point is on a curve.
2016-02-05 14:48:27 +01:00
Jürg Lehni
fc4bdf4bd0
Use correct SVG namespace again.
...
It got mixed up in recent refactoring (d68239a541
).
2016-02-03 18:39:00 +01:00
Jürg Lehni
f7b1aca3e4
Revert "Change the way we determine the winding in getWinding()."
2016-02-03 17:46:27 +01:00
Jürg Lehni
0152439627
Fix internalBounds regression caused by 1ac8e46d55
2016-02-03 17:39:03 +01:00
Jürg Lehni
41aca10112
Clean-up changes from #939
2016-02-03 12:54:54 +01:00
iconexperience
aed9d05bfc
Change the way we determine the winding in getWinding(). Now the windings only get counted if the point is not on any of the y-monotonic curves. If the point is on a curve, the winding will be made odd at the very end.
2016-02-03 11:29:43 +01:00
Jürg Lehni
96d617a5ff
Only attempt to reuse object that importJSON() is called on, when its type matches the root of the imported data.
...
Closes #764
2016-02-03 09:47:49 +01:00
Jürg Lehni
7888d1d107
JSON: Prevent name: undefined
exports.
2016-02-03 09:46:40 +01:00
Jürg Lehni
0f084eaf02
Optimize Emitter._installEvents()
...
Check for #_eventTypes first, no need to do anything if they don't exist.
2016-02-03 09:46:25 +01:00
Jürg Lehni
922a502ee2
Add #interpolate() method to Segment, Path and CompoundPath
...
Closes #624
2016-02-02 22:11:06 +01:00
Jürg Lehni
53269ab169
Merge pull request #938 from iconexperience/getWinding-simplification
...
Simplify getWindings() by using only the 'last' property to understand when a new loop starts.
2016-02-02 21:45:04 +01:00
Jürg Lehni
5e53939006
Do not include text-styles in items that don't relate to text.
...
Closes #934
2016-02-02 21:43:44 +01:00
iconexperience
0716ebb994
Simplify getWindings(), The first curve of a loop always has the 'last' property set. We use this to know when a loop starts. The very rare cases when a loop only consists of horizontal curves are not a problem, because these curves are ignored. Using this simplification also get's rid of the 'length' property, which was set in _getMonoCurves().
2016-02-02 21:23:46 +01:00
Jürg Lehni
8fb7c41537
Implement support for web-workers.
...
Relates to #634 , closes #582
2016-02-02 17:30:38 +01:00
Jürg Lehni
74d188967c
Fix accidentally leaked global variable.
2016-02-02 14:03:25 +01:00
Jürg Lehni
a71c364594
We cannot cache #strokeBounds when #strokeScaling is false.
...
Closes #697
2016-02-02 13:56:08 +01:00
Jürg Lehni
340a1e2a5f
Rename curve-time in API from 'parameter' to 'time'
...
And create separate versions of methods that receive curve-time arguments instead of offsets.
Curve#getNormalAt(time, true) -> #getNormalAtTime(true)
Curve#divide() -> #divideAt(offset) / #divideAtTime(time)
Curve#split() -> #splitAt(offset) / #splitAtTime(time)
Curve#getParameterAt(offset) -> #getTimeAt(offset)
Curve#getParameterOf(point) -> getTimeOf(point)
Curve#getPointAt(time, true) -> #getPointAtTime(time)
Curve#getTangentAt(time, true) -> #getTangenttTime(time)
Curve#getNormalAt(time, true) -> #getNormalAtTime(time)
Curve#getCurvatureAt(time, true) -> #getCurvatureAtTime(time)
CurveLocation#parameter -> #time
Path#split(offset/location) -> #splitAt(offset/location)
Closes #563
2016-02-02 11:59:53 +01:00
Jürg Lehni
a12e99e387
Implement unit tests for SVG Importing, based on visual comparison.
...
For now, one test for #932
2016-02-01 20:15:37 +01:00
Jürg Lehni
8e25327b09
Fix wrongly copied attributes in Item#reduce()
...
Closes #932
2016-02-01 20:12:54 +01:00
Jürg Lehni
ad21b2b07a
SVG: Pass the imported SVG date as the 2nd parameter to onLoad()
2016-02-01 20:09:43 +01:00
Jürg Lehni
b2f3b587ec
Events: paper namespace may not be initialized when key evens are emitted.
2016-02-01 12:58:52 +01:00
Jürg Lehni
1c4ff31e6c
SVG: Some renaming omitted in previous commit.
2016-02-01 12:52:50 +01:00
Jürg Lehni
af5984747f
SVG: Rename 'SVG' prefix to 'Svg'
...
- To make it clear it's not browser-provided functionality
- To reflect how DomElement / DomEvent are already named, for the same reason
2016-02-01 12:50:22 +01:00
Jürg Lehni
519898357f
SVG: Fix issue with invalid default stroke-width on IE.
...
Closes #467
2016-02-01 12:36:42 +01:00
Jürg Lehni
d68239a541
SVG: Introduce SVGNode object to handle SVG Elements.
2016-02-01 12:31:18 +01:00
Jürg Lehni
3d346d8045
Core: Do not serialize deprecated Style#font property.
...
Relates to #934
2016-02-01 12:19:12 +01:00
Jürg Lehni
50843d8f87
Node: Switch to jsdom v8.0.1 with patched-in image support.
...
And fix XMLSerializer#serializeToString() to work with it.
2016-01-31 22:47:57 +01:00
Jürg Lehni
bc2729683c
Core: Renamed Symbol and PlacedSymbol classes and properties.
...
- Symbol -> SymbolDefinition
- PlacedSymbol -> SymbolItem
- Symbol#definition -> SymbolDefinition#item
- PlacedSymbol#symbol -> SymbolItem#definition
- Deprecate Project#symbols
Closes #770
2016-01-31 16:52:51 +01:00
Jürg Lehni
1a3a4be0b6
Gulp: Implement publish task.
2016-01-31 14:30:14 +01:00
Jürg Lehni
90e1cf8f5e
Canvas: Throw an error if a canvas cannot provide a 2D context.
2016-01-31 12:43:38 +01:00
Jürg Lehni
e02e9f4643
Node: Improve DOMParser#parseFromString() polyfill for Node.js
...
And no need to move imported SVG nodes into document, since we don't have styling in Node.js
2016-01-31 12:43:38 +01:00
Jürg Lehni
4c84c3dad5
Tests: Start getting QUnit tests to work on Node.js
...
Work in progress…
2016-01-31 12:43:20 +01:00
Jürg Lehni
0c1b4376d3
Core: Fix issue with RegExp detection if object is from another context.
2016-01-31 12:43:03 +01:00
Jürg Lehni
fadef949ff
Node: Fix display of percentage in Node.js frames export.
2016-01-31 12:42:53 +01:00
sapics
923caaaaab
Fix path.arcTo error
2016-01-29 18:41:17 +09:00
Jürg Lehni
0455d39e33
Automatically determine correct padding for numbers in View#exportFrames()
2016-01-27 13:38:04 +01:00
Jürg Lehni
85d60e199e
Get View#exportFrames() to work again on Node.js
2016-01-27 13:27:11 +01:00
Jürg Lehni
e7c4e3c990
Implement View#autoUpdate to control automatic updates.
...
Closes #921
2016-01-27 13:10:04 +01:00
Jürg Lehni
b56d18d6a4
Override DomEvent.requestAnimationFrame() in Node.js to avoid setInterval() timers
2016-01-27 13:02:50 +01:00
Jürg Lehni
414742459d
Make sure PDF support actually works.
2016-01-27 12:51:26 +01:00
Jürg Lehni
1e649362bd
Fix issue in View#exportImage()
2016-01-27 12:51:02 +01:00
Jürg Lehni
b40ff49523
Add explanation about View#_itemEvents.native.
2016-01-27 12:17:38 +01:00
Jürg Lehni
5fa0810ca3
Streamline View#_countItemEvent() code a bit.
2016-01-27 12:15:00 +01:00
Jürg Lehni
0cfa83fc32
Make item-level mousedrag events work again.
2016-01-27 12:11:59 +01:00
Jürg Lehni
d22104985d
Fix spelling mistake.
2016-01-27 11:51:54 +01:00
Jürg Lehni
810428569a
Some jshint related fixes.
2016-01-27 11:45:20 +01:00
Jürg Lehni
d92628a432
Make click and doubleclick events work on View.
2016-01-27 11:38:45 +01:00
Jürg Lehni
3276616f53
Introduce Item._itemHandlers to remove code redundancy.
2016-01-27 11:38:14 +01:00
Jürg Lehni
ed8a904b74
Some Curve._evaluateMethods related cleanup.
2016-01-27 11:37:12 +01:00
Jürg Lehni
849688833e
Implement key events on View.
...
Closes #896
2016-01-27 11:36:39 +01:00
Jürg Lehni
0b991cefdd
Only mark an image as loaded if it actually has src set and is complete.
2016-01-27 10:45:39 +01:00
Jürg Lehni
8391543115
Further improve Raster documentation.
2016-01-27 10:39:03 +01:00
Jürg Lehni
9cf912090c
Implement Raster#_setImage() that doesn't trigger events.
...
For internal use / updates.
2016-01-27 10:33:01 +01:00
Jürg Lehni
26a64415a5
Document Raster#onLoad() and #onError()
2016-01-27 10:32:28 +01:00
Jürg Lehni
c5632d8a6a
Improve documentation for event handlers on View and Item.
2016-01-27 10:27:14 +01:00
Jürg Lehni
52017340d2
Do not fire two subsequent mousedown events.
...
This should fix #922 , but needs testing.
2016-01-27 09:53:09 +01:00
Jürg Lehni
caa93a51ca
Improve handling of removeOn*() and filter out duplicate move events.
...
Closes #913
2016-01-27 09:48:20 +01:00
Jürg Lehni
ee4760afc4
Fix issue with zoomed retina canvases when repeatetly initializing same view canvas.
2016-01-27 09:38:57 +01:00
Jürg Lehni
e722be5b62
Add support for PDF canvas on Node.js again.
2016-01-27 09:34:37 +01:00
Jürg Lehni
86f6d8eccd
Fix crash in unit tests.
2016-01-26 23:27:38 +01:00
Jürg Lehni
4af8999135
Clean up View#_handleFrame()
2016-01-26 22:35:46 +01:00
Jürg Lehni
b71ffdbe71
Remove all direct calls to view.update() and favor of the new view.requestUpdate()
...
Pure window.requestAnimationFrame() smoothness, automatic updates even when working directly from JavaScript, and no more slow-downs from onLoad events!
Closes #830 , #925
2016-01-26 21:37:27 +01:00
Jürg Lehni
9ad63a7231
Merge branch 'unified-version' into develop
2016-01-26 21:06:54 +01:00
Jürg Lehni
5e69de3bd1
Restructure event handling on Raster item.
...
- Trigger #onLoad() events from Raster#setImage() also
- Add support for Raster#onError() handler
Closes #849 and #924
2016-01-26 21:06:36 +01:00
Jürg Lehni
d33fff31b8
Always access "global" constructors on window object now.
2016-01-26 20:33:19 +01:00
Jürg Lehni
77be5616b6
Include paper-core.js in load.js mechanism, and improve root folder guessing again.
2016-01-26 20:26:32 +01:00
Jürg Lehni
6a099003b2
Improve some comments about new file structure.
2016-01-26 20:14:49 +01:00
Jürg Lehni
e1a51f858a
More work on unified version for browsers and node.
...
Relates to #739
2016-01-26 20:02:23 +01:00
Jürg Lehni
8b994ab640
Use paper.js indentation standard.
2016-01-26 17:02:08 +01:00
Jürg Lehni
87e6c0f2c3
Merge pull request #927 from sapics/minor-minifier
...
Simplify calculation in PathFitter
2016-01-26 17:00:02 +01:00
Jürg Lehni
a38834b81d
Further refined code from 095cd47c1c
2016-01-26 16:59:27 +01:00
Jürg Lehni
15797903cf
Update to jsdom v7.2.2 with https://github.com/tmpvar/jsdom/pull/1366 back-portedd.
2016-01-26 16:51:40 +01:00
Jürg Lehni
7781ecb76a
Some minor cleanups.
2016-01-26 16:29:13 +01:00
Jürg Lehni
46f415ca81
More work on source-map support for node.js
...
Relates to #656
2016-01-26 12:38:58 +01:00
Jürg Lehni
c479ec9272
Start with transition to unified version.
...
Relates to #739
2016-01-26 11:41:49 +01:00
sapics
e8137ccedb
Simplify calculation in PathFitter
2016-01-26 19:34:27 +09:00
sapics
095cd47c1c
Minifier matrix._transformCoordinates function
2016-01-26 12:07:34 +09:00
Jürg Lehni
1ae95999d5
Fix CompoundPath#insertChildren() when passing children lists from otheer items.
2016-01-24 17:59:39 +01:00
Jürg Lehni
fb9bdb4b39
Fetch all dev-dependencies NPM instead of Bower.
2016-01-23 19:01:38 +01:00
Jürg Lehni
145135b4f5
Give tracePaths() the capability to deal with open paths.
...
Relates to #912
2016-01-23 11:40:22 +01:00
Jürg Lehni
36e31eb250
Implement better handling of Raster#source and Raster#toDataURL() on Node.js
...
Closes #914
2016-01-22 17:05:50 +01:00
sapics
ecc36ec3cc
Remove unused variable in group._draw
2016-01-20 14:35:28 +09:00
Jürg Lehni
e4b03a7915
More code cleanup and simplifications in Matrix.
...
Relates to #915
2016-01-19 10:14:20 +01:00
sapics
627a63cc5b
Fix matrix invert calculation
2016-01-19 16:08:39 +09:00
Jürg Lehni
6a0222ff21
Minor cleanup.
2016-01-18 11:03:30 +01:00
Jürg Lehni
8f0a2f37a0
Merge pull request #911 from sapics/hit-stroke
...
Add stroke hit-test option for shape items
2016-01-18 10:57:42 +01:00
Jürg Lehni
5cb4ab732b
Improve code explanation in load.js
2016-01-18 10:21:28 +01:00
Jürg Lehni
503fe11e41
Fix build issues on Travis and improve version handling in Gulp.js and Prepro.js
...
This reverts commit eaceb1bfc3
.
2016-01-18 09:56:02 +01:00
sapics
9c4296eda0
Add stroke hit-test option for shape items
2016-01-18 10:04:53 +09:00
Jürg Lehni
eaceb1bfc3
Some more work on gulp
...
Change the way versions are handled, and append the branch name if we're not publishing from master.
2016-01-18 01:18:57 +01:00
Jürg Lehni
4351ca310f
Fix hit-testing on Shape items and #strokeScaling.
...
Closes #697 .
2016-01-18 00:41:48 +01:00
Jürg Lehni
1ac8e46d55
Various fixes on handling of #strokeScaling and #strokeBounds calculations.
2016-01-17 23:57:56 +01:00
Jürg Lehni
ea7216d9fb
Improve _getStrokeMatrix() fix to correctly handle nested matrices.
2016-01-17 23:39:28 +01:00
Jürg Lehni
fd72ad0937
Correctly handle #strokeScaling in Path item hit-tests.
...
Hit-testing of Shape items with #strokeScaling still needs fixing too.
Relates to #697 .
2016-01-17 21:46:35 +01:00
Jürg Lehni
43a6c57cd6
Correctly handle #strokeScaling when calculating Path and Shape bounds.
...
Relates to #697
2016-01-17 20:27:25 +01:00
Jürg Lehni
40551fcacf
Make Matrix#orNullIfIdentity() private too, and fix error introduced by previous commit.
2016-01-17 19:34:54 +01:00