Set upper bound for scaling factor.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10615 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Pfeiffer 2005-01-08 14:07:23 +00:00
parent 43a3d8de3f
commit 66a207d9bd
1 changed files with 4 additions and 0 deletions

View File

@ -251,6 +251,7 @@ PageSetupWindow::PageSetupWindow(BMessage *msg, const char *printerName)
for (num = 0; num <= 9; num++) {
fScaleControl->TextView()->AllowChar('0' + num);
}
fScaleControl->TextView()->SetMaxBytes(3);
panel->AddChild(fScaleControl);
@ -302,6 +303,9 @@ PageSetupWindow::UpdateSetupMessage()
if (scale <= 0.0) { // sanity check
scale = 100.0;
}
if (scale > 1000.0) {
scale = 1000.0;
}
SetFloat(fSetupMsg, "scale", scale);
float scaleR = 100.0 / scale;