Skip to content

Commit

Permalink
Set smaller min scale values for in MamutBranchViewGrapher so that fu…
Browse files Browse the repository at this point in the history
…rther zoom in is possible
  • Loading branch information
stefanhahmann authored and tinevez committed Sep 23, 2024
1 parent faeb41e commit 9eb7c9f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import org.mastodon.views.grapher.display.FeatureGraphConfig;
import org.mastodon.views.grapher.display.FeatureGraphConfig.GraphDataItemsSource;
import org.mastodon.views.grapher.display.FeatureSpecPair;
import org.mastodon.views.grapher.display.InertialScreenTransformEventHandler;

import java.util.Iterator;
import java.util.function.BiConsumer;
Expand All @@ -75,6 +76,9 @@ public class MamutBranchViewGrapher extends MamutBranchView< DataGraph< BranchSp
grapherInitializer = new GrapherInitializer<>( viewGraph, appModel, selectionModel, navigationHandler, focusModel, highlightModel,
getGroupHandle() );
grapherInitializer.getFrame().setTitle( "Grapher Branch" );
InertialScreenTransformEventHandler handler = grapherInitializer.getFrame().getDataDisplayPanel().getTransformEventHandler();
handler.setMinScaleX( 0.1d );
handler.setMinScaleY( 0.1d );
grapherInitializer.setOnClose( this );
grapherInitializer.initFeatureConfig( getFeatureGraphConfig() );
setFrame( grapherInitializer.getFrame() ); // this creates viewActions and viewBehaviours thus must be called before installActions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,16 @@ public synchronized void updateAxesSize( final int width, final int height )
updateTransformScreenSize();
}

public void setMinScaleY( final double minScaleY )
{
this.minScaleY = minScaleY;
}

public void setMinScaleX( final double minScaleX )
{
this.minScaleX = minScaleX;
}

private void updateTransformScreenSize()
{
final ScreenTransform transform = transformState.get();
Expand Down

0 comments on commit 9eb7c9f

Please sign in to comment.