-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix(polyline): stroke bounding rect calculation typescript #8344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ShaMan123
merged 96 commits into
fabricjs:master
from
luizzappa:poly-stroke-bounding-rect-ts
Oct 15, 2022
Merged
Changes from 16 commits
Commits
Show all changes
96 commits
Select commit
Hold shift + click to select a range
03c5360
feat(getOrthogonalUnitVector)
75722d1
fix(calcAngleBetweenVectors): use atan2 instead of dot product
b4b866e
fix(getBisector): since calcAngleBetweenVectors use atan2, we don't h…
efaf936
feat(): add hypot in misc.ts
4aac2d4
fix(getHatVector): change Math#hypot for misc#hypot
0c86b4a
style(getHatVector)
975dd1d
test(): add hypot test
430619f
test(): removed only
4327d7f
refactor(polyline#_calcDimensions): remove exactBoundingBox logic and…
7db09ce
fix(polyline#_setPositionDimensions): correctly calculate width, heig…
e5b2f1c
fix(): extend _getTransformedDimensions in polyline
73b8830
fix(): extend _set in polyline
a72a48f
fix(projectStrokeOnPoints)
4ce9c12
feat(hypot): hard coded hypot calculatoin to deal with precision betw…
935f406
fix(_getTransformedDimensions)
397126d
fix(projectStrokeOnPoints)
0a3d662
refactor(projectStrokeOnPoints): create function to each line join type
d1af8ce
fix(polyline): import instead of using namespace
8a54b08
refactor(polyline): pathOffset as a Point
7bdf5ba
refactor(polyline): replace vars
1193892
refactor(polyline#_set): add the conditions to the if statement
4bd47a8
style(projectStrokeOnPoints): JSDocs, missing semi colons
0d5b5f3
refactor(projectStrokeOnPoints): instance of Point with a single argu…
3eec3d1
feat(point#magnitude): add vector lenght in Point class
3bef574
refactor(projectStrokeOnPoints): call magnitude from Point class
fc42532
refactor(projectStrokeOnPoints): calcAngleBetweenVectors instead of M…
2b98c74
refactor(projectStrokeOnPoints): hat vector as const
735fe66
refactor(projectStrokeOnPoints): updated links to docs
2e61973
refactor(projectStrokeOnPoints): calculation of strokeMiterLimit with…
d2a199a
docs(projectStrokeOnPoints)
9dd7850
fix(projectStrokeOnPoints): remove applySkew from projectionsRoundNoSkew
1788eb6
fix(): optional tag to include number type
ShaMan123 81a1cf5
restore test/unit/polygon.js
997c415
refactor(projectStrokeOnPoints): create isAcute function to abstract …
f2c46a8
style(projectStrokeOnPoints): remove jsdocs types
f3d539a
style(hypot): typo
034a90a
refactor(projectStrokeOnPoints): projections as standalone functions
1636dd9
style(): prettier
37db1d6
refactor(): `_setPositionDimensions`
ShaMan123 0293390
refactor(): `_getTransformedDimensions`
ShaMan123 481b952
uglify(): keep backward style for migration compat
ShaMan123 5fa519f
refactor(vectors): es6, types, style
ShaMan123 90b4464
rename types
ShaMan123 592ae06
no function
ShaMan123 71b15f7
fix(`projectionsOpenPathButt`): dir can be determined
ShaMan123 02bdd2f
rename
ShaMan123 f8f12c2
refactor(): tidy
ShaMan123 5a2abdf
Update polyline.class.ts
ShaMan123 06c49aa
import
ShaMan123 e6706f2
Update projectStroke.ts
ShaMan123 023b1a6
fix(): imports
ShaMan123 584793b
refactor(): modularize
d7a28e8
refactor(): modularize squash
b744dde
refactor(): rename getOrthogonalUnitVector to getOrthonormalVector
10b1092
docs(): A B C JSDOC
ShaMan123 2c81536
fix(StrokeLineCapProjections#projectButt)
2ff9ee2
fix(StrokeLineJoinProjections#projectRoundWithSkew): correct calculat…
31b28a2
Merge commit 'refs/pull/8344/head' of github.com:fabricjs/fabric.js i…
5ff9847
fix(StrokeLineJoinProjections#projectRoundWithSkew): missing newY
0927c7e
fix(): `_setPositionDimensions` noSVG
ShaMan123 9eff7ad
refactor(): `_setPositionDimensions` + extract
ShaMan123 cfc186b
Update polygon.js
ShaMan123 c6f9906
fix(); glitch 9eff7adb
ShaMan123 3d8c33a
expose `setDimensions`
ShaMan123 b23f359
docs(changelog)
b7cc6d6
Merge branch 'master' into pr/8344
ShaMan123 f2afe77
safeguard(): no points
ShaMan123 ea35f21
fix(): return `Point[]`
ShaMan123 53a35b8
fix(): `_calcDimensions`
ShaMan123 94db2c5
fix(): imports
ShaMan123 ab5f63b
fix(path): account for `L` bounds
ShaMan123 5f57838
fix(polyline): `_getNonTransformedDimensions`
ShaMan123 c2ee044
fix? svg import
ShaMan123 873fc49
Merge branch 'master' into pr/8344
ShaMan123 d6b07f4
WIP: bbox + stroke
ShaMan123 0157f22
fix(): `exactBoundbox = false`
ShaMan123 9568563
tests
ShaMan123 253c228
Update CHANGELOG.md
ShaMan123 d624dcb
prettier
ShaMan123 62979a9
test(): adapt config
ShaMan123 5d81cf5
strokeOffset
ShaMan123 e0b954c
Merge branch 'master' into pr/8344
ShaMan123 c3b5254
fix(): testem browser start timeout
ShaMan123 5a98929
fix(): minor error
ShaMan123 d66f14d
fix(): line cap `round` `square` cases
ShaMan123 e4b48da
JSDOC
ShaMan123 76f5711
better
ShaMan123 f4de029
cleanup
ShaMan123 648d364
remove redundant projections + cases
ShaMan123 883e4b7
extract `magnitude` to vectors
ShaMan123 34460df
remove `hypot`
ShaMan123 aafe3a1
minor
ShaMan123 301276f
`strokeBBoxAffectingProperties`
ShaMan123 41d777e
syntax
ShaMan123 f158267
better svg options
ShaMan123 42d8f17
Merge branch 'master' into poly-stroke-bounding-rect-ts
asturur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| /** | ||
| * Returns the square root of the sum of squares of its arguments\ | ||
| * Chrome implements `Math#hypot` with a calculation that affects percision so we hard code it as a util | ||
luizzappa marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * @see https://stackoverflow.com/questions/62931950/different-results-of-math-hypot-on-chrome-and-firefox | ||
| * @static | ||
| * @memberOf fabric.util | ||
| * @param {...number} values | ||
| * @return {number} | ||
| */ | ||
| export const hypot = (...values: number[]): number => { | ||
| let sumOfSquares = 0; | ||
| for (let i = 0; i < values.length; i++) { | ||
| sumOfSquares += values[i] * values[i]; | ||
| } | ||
| return Math.sqrt(sumOfSquares); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.