mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
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:
@@ -39,10 +39,14 @@ void TextValueViewer::draw(RotatedDC& dc) {
|
||||
}
|
||||
|
||||
void TextValueViewer::onValueChange() {
|
||||
v.reset();
|
||||
v.reset(false);
|
||||
}
|
||||
|
||||
void TextValueViewer::onStyleChange(bool already_prepared) {
|
||||
v.reset();
|
||||
v.reset(true);
|
||||
if (!already_prepared) viewer.redraw(*this);
|
||||
}
|
||||
|
||||
void TextValueViewer::onAction(const Action&, bool undone) {
|
||||
v.reset(true);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ class TextValueViewer : public ValueViewer {
|
||||
virtual void draw(RotatedDC& dc);
|
||||
virtual void onValueChange();
|
||||
virtual void onStyleChange(bool);
|
||||
virtual void onAction(const Action&, bool undone);
|
||||
|
||||
protected:
|
||||
TextViewer v;
|
||||
|
||||
Reference in New Issue
Block a user