File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -97,11 +97,13 @@ impl super::View for ContextMenus {
97
97
egui:: Grid :: new ( "button_grid" ) . show ( ui, |ui| {
98
98
ui. add (
99
99
egui:: DragValue :: new ( & mut self . width )
100
+ . clamp_range ( 0.0 ..=f32:: INFINITY )
100
101
. speed ( 1.0 )
101
102
. prefix ( "Width: " ) ,
102
103
) ;
103
104
ui. add (
104
105
egui:: DragValue :: new ( & mut self . height )
106
+ . clamp_range ( 0.0 ..=f32:: INFINITY )
105
107
. speed ( 1.0 )
106
108
. prefix ( "Height: " ) ,
107
109
) ;
Original file line number Diff line number Diff line change @@ -742,7 +742,7 @@ impl Plot {
742
742
margin_fraction,
743
743
width,
744
744
height,
745
- min_size,
745
+ mut min_size,
746
746
data_aspect,
747
747
view_aspect,
748
748
mut show_x,
@@ -773,6 +773,10 @@ impl Plot {
773
773
774
774
// Determine position of widget.
775
775
let pos = ui. available_rect_before_wrap ( ) . min ;
776
+ // Minimum values for screen protection
777
+ min_size. x = min_size. x . at_least ( 1.0 ) ;
778
+ min_size. y = min_size. y . at_least ( 1.0 ) ;
779
+
776
780
// Determine size of widget.
777
781
let size = {
778
782
let width = width
You can’t perform that action at this time.
0 commit comments