MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / SetZoomLevel

Method SetZoomLevel

Source/ModularSynth.cpp:478–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

476}
477
478void ModularSynth::SetZoomLevel(float zoomLevel)
479{
480 float oldDrawScale = gDrawScale;
481 gDrawScale = zoomLevel;
482 float zoomAmount = (gDrawScale - oldDrawScale) / oldDrawScale;
483 ofVec2f zoomCenter = ofVec2f(ofGetWidth() / gDrawScale * .5f, ofGetHeight() / gDrawScale * .5f);
484 GetDrawOffset() -= zoomCenter * zoomAmount;
485 mZoomer.CancelMovement();
486 mHideTooltipsUntilMouseMove = true;
487}
488
489void ModularSynth::PanView(float x, float y)
490{

Callers 1

OnMidiPitchBendMethod · 0.80

Calls 4

ofVec2fClass · 0.85
ofGetWidthFunction · 0.85
ofGetHeightFunction · 0.85
CancelMovementMethod · 0.80

Tested by

no test coverage detected