File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -436,9 +436,19 @@ class RPadPainter extends RObjectPainter {
436436 this . createAttFill ( { pattern : 1001 , color : 0 } ) ;
437437
438438 if ( ( rect . width <= lmt ) || ( rect . height <= lmt ) ) {
439- svg . style ( 'display' , 'none' ) ;
440- console . warn ( `Hide canvas while geometry too small w=${ rect . width } h=${ rect . height } ` ) ;
441- rect . width = 200 ; rect . height = 100 ; // just to complete drawing
439+ if ( this . snapid === undefined ) {
440+ svg . style ( 'display' , 'none' ) ;
441+ console . warn ( `Hide canvas while geometry too small w=${ rect . width } h=${ rect . height } ` ) ;
442+ }
443+ if ( this . _pad_width && this . _pad_height ) {
444+ // use last valid dimensions
445+ rect . width = this . _pad_width ;
446+ rect . height = this . _pad_height ;
447+ } else {
448+ // just to complete drawing.
449+ rect . width = 800 ;
450+ rect . height = 600 ;
451+ }
442452 } else
443453 svg . style ( 'display' , null ) ;
444454
Original file line number Diff line number Diff line change @@ -682,8 +682,10 @@ class TPadPainter extends ObjectPainter {
682682 this . createAttFill ( { attr : this . pad } ) ;
683683
684684 if ( ( rect . width <= lmt ) || ( rect . height <= lmt ) ) {
685- svg . style ( 'display' , 'none' ) ;
686- console . warn ( `Hide canvas while geometry too small w=${ rect . width } h=${ rect . height } ` ) ;
685+ if ( this . snapid === undefined ) {
686+ svg . style ( 'display' , 'none' ) ;
687+ console . warn ( `Hide canvas while geometry too small w=${ rect . width } h=${ rect . height } ` ) ;
688+ }
687689 if ( this . _pad_width && this . _pad_height ) {
688690 // use last valid dimensions
689691 rect . width = this . _pad_width ;
You can’t perform that action at this time.
0 commit comments