Oops, don't allow the user to type a zero or negative scale in the
view screen. [git-p4: depot-paths = "//depot/solvespace/": change = 2104]solver
parent
5302aad1cc
commit
e8b0cd1f9d
7
view.cpp
7
view.cpp
|
@ -62,7 +62,12 @@ bool TextWindow::EditControlDoneForView(char *s) {
|
|||
case EDIT_VIEW_SCALE: {
|
||||
Expr *e = Expr::From(s, true);
|
||||
if(e) {
|
||||
SS.GW.scale = e->Eval() / SS.MmPerUnit();
|
||||
double v = e->Eval() / SS.MmPerUnit();
|
||||
if(v > LENGTH_EPS) {
|
||||
SS.GW.scale = v;
|
||||
} else {
|
||||
Error("Scale cannot be zero or negative.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue