@@ -519,6 +519,8 @@ export class MPLCanvasView extends DOMWidgetView {
519
519
return ;
520
520
}
521
521
522
+ this . top_context . save ( ) ;
523
+
522
524
this . context . clearRect ( 0 , 0 , this . canvas . width , this . canvas . height ) ;
523
525
this . context . drawImage ( this . model . offscreen_canvas , 0 , 0 ) ;
524
526
@@ -534,6 +536,13 @@ export class MPLCanvasView extends DOMWidgetView {
534
536
this . model . get ( '_rubberband_width' ) !== 0 &&
535
537
this . model . get ( '_rubberband_height' ) !== 0
536
538
) {
539
+ this . top_context . strokeStyle = 'gray' ;
540
+ this . top_context . lineWidth = 1 ;
541
+ this . top_context . shadowColor = 'black' ;
542
+ this . top_context . shadowBlur = 2 ;
543
+ this . top_context . shadowOffsetX = 1 ;
544
+ this . top_context . shadowOffsetY = 1 ;
545
+
537
546
this . top_context . strokeRect (
538
547
this . model . get ( '_rubberband_x' ) ,
539
548
this . model . get ( '_rubberband_y' ) ,
@@ -544,18 +553,19 @@ export class MPLCanvasView extends DOMWidgetView {
544
553
545
554
// Draw resize handle
546
555
if ( this . model . get ( 'resizable' ) ) {
547
- this . top_context . save ( ) ;
548
-
549
556
const gradient = this . top_context . createLinearGradient (
550
- this . top_canvas . width - this . resize_handle_size / 3 ,
551
- this . top_canvas . height - this . resize_handle_size / 3 ,
552
- this . top_canvas . width - this . resize_handle_size / 4 ,
553
- this . top_canvas . height - this . resize_handle_size / 4
557
+ // Start
558
+ this . top_canvas . width - this . resize_handle_size ,
559
+ this . top_canvas . height - this . resize_handle_size ,
560
+ // Stop
561
+ this . top_canvas . width ,
562
+ this . top_canvas . height
554
563
) ;
555
- gradient . addColorStop ( 0 , 'rgba(0, 0, 0, 0) ' ) ;
556
- gradient . addColorStop ( 1 , 'rgba(0, 0, 0, 255) ' ) ;
564
+ gradient . addColorStop ( 0 , 'white ' ) ;
565
+ gradient . addColorStop ( 1 , 'black ' ) ;
557
566
558
567
this . top_context . fillStyle = gradient ;
568
+ this . top_context . strokeStyle = 'gray' ;
559
569
560
570
this . top_context . globalAlpha = 0.3 ;
561
571
this . top_context . beginPath ( ) ;
@@ -573,9 +583,10 @@ export class MPLCanvasView extends DOMWidgetView {
573
583
) ;
574
584
this . top_context . closePath ( ) ;
575
585
this . top_context . fill ( ) ;
576
-
577
- this . top_context . restore ( ) ;
586
+ this . top_context . stroke ( ) ;
578
587
}
588
+
589
+ this . top_context . restore ( ) ;
579
590
}
580
591
581
592
_update_cursor ( ) {
0 commit comments