Browse Source

Introjucer: zooming fix.

tags/2021-05-28
jules 13 years ago
parent
commit
9792475bdc
1 changed files with 11 additions and 11 deletions
  1. +11
    -11
      extras/Introjucer/Source/ComponentEditor/ui/jucer_JucerDocumentEditor.cpp

+ 11
- 11
extras/Introjucer/Source/ComponentEditor/ui/jucer_JucerDocumentEditor.cpp View File

@@ -516,6 +516,14 @@ double JucerDocumentEditor::getZoom() const
return 1.0;
}
static double snapToIntegerZoom (double zoom)
{
if (zoom >= 1.0)
return (double) (int) (zoom + 0.5);
return 1.0 / (int) (1.0 / zoom + 0.5);
}
void JucerDocumentEditor::addElement (const int index)
{
if (PaintRoutinePanel* const panel = dynamic_cast <PaintRoutinePanel*> (tabbedComponent.getCurrentContentComponent()))
@@ -919,17 +927,9 @@ bool JucerDocumentEditor::perform (const InvocationInfo& info)
showGraphics (0);
break;
case JucerCommandIDs::zoomIn:
setZoom (getZoom() * 2.0);
break;
case JucerCommandIDs::zoomOut:
setZoom (getZoom() / 2.0);
break;
case JucerCommandIDs::zoomNormal:
setZoom (1.0);
break;
case JucerCommandIDs::zoomIn: setZoom (snapToIntegerZoom (getZoom() * 2.0)); break;
case JucerCommandIDs::zoomOut: setZoom (snapToIntegerZoom (getZoom() / 2.0)); break;
case JucerCommandIDs::zoomNormal: setZoom (1.0); break;
case JucerCommandIDs::spaceBarDrag:
if (EditingPanelBase* panel = dynamic_cast <EditingPanelBase*> (tabbedComponent.getCurrentContentComponent()))


Loading…
Cancel
Save