Improved search algorithm for determining text size:

- check using previous scale, often gives correct answer when typing
 - binary search + bound estimation otherwise
This allows the step size to be decreased, giving a better fit.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@624 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-08-24 20:04:26 +00:00
parent 74db393f61
commit f12bc70425
7 changed files with 149 additions and 63 deletions
+1 -1
View File
@@ -54,5 +54,5 @@ double FontTextElement::minScale() const {
return min(font->size(), font->scale_down_to) / max(0.01, font->size());
}
double FontTextElement::scaleStep() const {
return 1. / max(font->size(), 1.);
return 1. / max(font->size() * 4, 1.);
}