File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ class BroadBrushHelper {
256256 if ( options . simplifySize > 0 && this . finalPath . segments ) this . simplify ( options . simplifySize ) ;
257257 return this . finalPath ;
258258 }
259+
259260 let delta = this . lastVec ;
260261
261262 // If the mouse up is at the same point as the mouse drag event then we need
@@ -264,6 +265,18 @@ class BroadBrushHelper {
264265 // The given event.delta is the difference between the mouse down coords and the mouse up coords,
265266 // but we want the difference between the last mouse drag coords and the mouse up coords.
266267 delta = event . point . subtract ( this . lastPoint ) ;
268+
269+ if ( event . modifiers . shift ) {
270+ // 45 degree movement
271+ delta = snapDeltaToAngle ( delta , Math . PI / 4 ) ;
272+ } else if ( event . modifiers . alt ) {
273+ // vertical movement
274+ delta = new paper . Point ( 0 , delta . y ) ;
275+ } else if ( event . modifiers . control || event . modifiers . meta ) {
276+ // horizontal movement
277+ delta = new paper . Point ( delta . x , 0 ) ;
278+ }
279+
267280 const step = delta . normalize ( options . brushSize / 2 ) ;
268281 step . angle += 90 ;
269282
You can’t perform that action at this time.
0 commit comments