Commit graph

401 commits

Author SHA1 Message Date
Christopher Willis-Ford
b92798d41c Merge branch 'develop' into update-eslint-smore 2022-08-25 13:37:33 -07:00
Christopher Willis-Ford
3004a2a5cd update fill preview on mouse-down 2021-03-19 14:18:26 -07:00
Christopher Willis-Ford
244da0b27d simulate move to update hover on fill tool mouse up 2021-03-17 00:32:15 -07:00
Sarah Otts
1d5467c6b1
Merge branch 'develop' into update-eslint 2021-03-08 13:49:39 -05:00
Paul Kaplan
7ab106ee27 Update eslint and fix duplicate import errors 2021-02-09 12:20:26 -05:00
seotts
706ee3ad5a update eslint, babel-eslint, and eslint-config-scratch 2020-11-10 16:39:11 -05:00
DD Liu
53cb72d527 Remove dependency on svg renderer 2020-10-13 20:59:07 -04:00
DD Liu
889cd0a0dd If theres no display gradient, the second color of the gradient is ignored. 2020-08-28 01:12:11 -04:00
DD Liu
84da7aa842 Revert the code that converted a transparent-to-transparent gradient to a transparent solid color on select, because that was causing the bug where when you switched gradient twice with trans-trans, it became black-white. Instead, leave the color as a trans-trans gradient, but treat it as if its solid when switching colors. Its starting to keep track of a lot of secret state, which seems brittle... 2020-08-28 00:46:33 -04:00
DD Liu
c62093febe Change transparent fills to black and white when a gradient is added 2020-08-25 06:00:26 -04:00
DD Liu
544d833b53 Remove transparent to transparent gradients. Hide the second color of stroke width 0 gradients again. 2020-08-21 11:23:54 -04:00
DD Liu
35749e5b37 Make transparent color switch to black and white when a gradient type is applied 2020-08-21 10:28:08 -04:00
DD Liu
474b309f7a Remove unnecessary change 2020-08-13 16:48:45 -04:00
DD Liu
d2a78a9e9f Lint 2020-08-08 21:42:32 -04:00
DD Liu
4ec6bcae99 Don't report the gradient type as solid when it's a transparent to transparent gradient, because then switching to a gradient doesn't add a stroke width as expected 2020-08-08 02:19:56 -04:00
DD Liu
92ec567887 Fix stroke width showing 0 when the first color of a gradient is transparent. Fix "MIXED" being the secondary gradient color 2020-08-08 02:11:45 -04:00
adroitwhiz
c0cf25b8c0 Make secondary color always visibly differ 2020-07-29 16:43:32 -04:00
adroitwhiz
92ac312ad8 Rename getRotatedColor to getSecondaryColor
This function is used to generate a "secondary" color for gradients.
It will soon do things other than rotate the hue.
2020-07-29 16:43:21 -04:00
adroitwhiz
4f86762737
Merge pull request #1004 from adroitwhiz/stroke-gradient
Implement gradient outlines
2020-07-28 16:47:01 -04:00
adroitwhiz
0f5fb40425
Merge pull request #1166 from adroitwhiz/stroke-gradient-part-1
Gradient outlines part 1
2020-07-28 16:46:45 -04:00
adroitwhiz
272a10c91f Also enforce minimum gradient size in select mode
Oops
2020-07-28 16:36:55 -04:00
adroitwhiz
379599905a Enforce minimum gradient width for fill tool 2020-07-28 16:01:49 -04:00
DD Liu
01864080ad Merge branch 'reshapeCurves' of github.com:fsih/scratch-paint into reshapeCurves 2020-07-28 13:47:32 -04:00
DD Liu
3039b48849 Merge branch 'develop' into reshapeCurves 2020-07-28 13:47:13 -04:00
DD Liu
311422334f
Update src/helper/selection-tools/reshape-tool.js
Update comment to remove stroke

Co-authored-by: adroitwhiz <adroitwhiz@protonmail.com>
2020-07-28 13:00:32 -04:00
adroitwhiz
852eefc2d7 Fix gradient outlines with 0 width in select mode
Previously, if you selected a shape with a gradient outline that had a
width of 0, its outline color wouldn't be null when it should have been.
2020-07-28 08:39:49 -04:00
adroitwhiz
98daa5ee5d Gradients in line mode
The UX here isn't the best thing in the world but I think having the
functionality is important judging from the playtest
2020-07-28 08:39:49 -04:00
adroitwhiz
689532f269 Enforce minimum gradient size
This fixes the bug where percertly horizontal gradients on perfectly
vertical lines and vice versa would not be rendered at all
2020-07-28 08:39:49 -04:00
adroitwhiz
6ab7b4c67d Remove unnecessary bitmapMode params 2020-07-28 08:39:49 -04:00
adroitwhiz
a304dea338 Add gradients to bitmap shape tools 2020-07-28 08:39:49 -04:00
adroitwhiz
9f77faf5c1 Don't set color in bitmap shape onSelectionChanged
This *should* be safe because OvalTool and RectTool's wrapper "mode"
components, the only places that call onSelectionChanged, also update
the tools' color, and the color state reducers will always set the color
every time the selection changes, meaning it'll be updated anyway.
2020-07-28 08:39:49 -04:00
adroitwhiz
f625109c67 Make styleShape more flexible
Now, you can pass null in for a color instead of
{primary: null, secondary: null, gradientType: GradientTypes.SOLID}
and it'll still clear the color. Passing strokeWidth is also
optional now.
2020-07-28 08:39:49 -04:00
adroitwhiz
c81853b1b7 Make fill tool work for outlines 2020-07-28 08:39:49 -04:00
adroitwhiz
2eab5048ac Add hit result to hovered item data 2020-07-28 08:39:49 -04:00
adroitwhiz
df1989d0b0 Add gradients to vector shape tools 2020-07-28 08:39:49 -04:00
adroitwhiz
6094953ef4 Wire up stroke gradient controls
* Abstract FillColorIndicator and StrokeColorIndicator to ColorIndicator
* Replace stroke color reducer with stroke style reducer
* Add color style proptype
* Clear stroke gradient in line mode
2020-07-23 05:57:52 -04:00
adroitwhiz
f8da455005 Use createGradientObject in applyGradientTypeToSelection 2020-07-23 05:57:01 -04:00
adroitwhiz
1ecab99cfb Make style-path helpers generic over fill & stroke 2020-07-23 05:54:57 -04:00
adroitwhiz
b59af02254
Merge pull request #1006 from adroitwhiz/broad-brush-braces
Improve broad brush handling
2020-07-21 16:07:28 -04:00
adroitwhiz
1017911fd4 color -> style, move selection gradient into it
A "style" refers to something that can fill/stroke a shape.
Currently that's either a solid color or a gradient of some orientation.
The selection gradient type reducer has been removed and folded into the
"fill style" reducer.
2020-07-09 17:52:08 -04:00
adroitwhiz
018958ce7b Combine fill-color and fill-color-2 reducers 2020-07-09 17:13:41 -04:00
Jacco Kulman
5a154e708e ungroup 2020-06-27 14:41:24 +02:00
DD Liu
42f74fd3a8 Reshape should hit curves, not strokes 2020-06-23 16:51:09 -04:00
DD Liu
e90000b20b
Merge pull request #1120 from Jacco/fix-379
prevent scaling factor too low (per direction)
2020-06-18 21:37:35 -04:00
Jacco Kulman
0f24b4b6b5 MIN_SCALE_FACTOR & clamping instead of halting 2020-06-17 06:47:20 +02:00
adroitwhiz
013aa47bc9
Merge pull request #1108 from adroitwhiz/no-origrot
Stop setting item.data.origRot
2020-06-15 10:59:16 -04:00
Jacco Kulman
e44127b492 prevent scaling factor too low (per direction) 2020-06-13 15:11:20 +02:00
adroitwhiz
2a1eaa8926
Merge pull request #997 from adroitwhiz/adjust-reshape-tolerance
Adjust reshape mode handle tolerance
2020-06-09 13:19:00 -04:00
adroitwhiz
e22295b68c Add handle padding and radius 2020-06-08 16:49:49 -04:00
adroitwhiz
32e80364c1
Merge pull request #1000 from adroitwhiz/addpoint-divideat
Use divideAt in PointTool.addPoint so that adding new points doesn't affect curves' shape
2020-06-04 15:22:29 -04:00