File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -512,6 +512,17 @@ class SketchField extends PureComponent {
512512 return discarded
513513 } ;
514514
515+ hasSelection = ( ) => {
516+ let canvas = this . _fc ;
517+ return ! ! canvas . getActiveObject ( ) ;
518+ }
519+
520+ clearSelection = ( ) => {
521+ let canvas = this . _fc ;
522+ canvas . discardActiveObject ( ) ;
523+ canvas . requestRenderAll ( ) ;
524+ }
525+
515526 /**
516527 * Remove selected object from the canvas
517528 */
Original file line number Diff line number Diff line change @@ -175,6 +175,9 @@ declare module 'react-sketch' {
175175 */
176176 clear ( propertiesToInclude ?: ArrayLike < string > ) : string
177177
178+ hasSelection ( ) : boolean
179+ clearSelection ( ) : void
180+
178181 /**
179182 * Remove selected object from the canvas
180183 */
You can’t perform that action at this time.
0 commit comments