From e3e0829f9fb59144a1ce6e3ae99f25dc2641ecb2 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 20 Jul 2022 15:44:03 +0100 Subject: [PATCH] JAL-4045 - don't apply distribution dependent scale factor to the axis lines! --- src/jalview/gui/RotatableCanvas.java | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/jalview/gui/RotatableCanvas.java b/src/jalview/gui/RotatableCanvas.java index d695ebb..ef0b2aa 100755 --- a/src/jalview/gui/RotatableCanvas.java +++ b/src/jalview/gui/RotatableCanvas.java @@ -20,17 +20,6 @@ */ package jalview.gui; -import jalview.api.RotatableCanvasI; -import jalview.datamodel.Point; -import jalview.datamodel.SequenceGroup; -import jalview.datamodel.SequenceI; -import jalview.datamodel.SequencePoint; -import jalview.math.RotatableMatrix; -import jalview.math.RotatableMatrix.Axis; -import jalview.util.ColorUtils; -import jalview.util.MessageManager; -import jalview.viewmodel.AlignmentViewport; - import java.awt.Color; import java.awt.Dimension; import java.awt.Font; @@ -53,6 +42,17 @@ import java.util.List; import javax.swing.JPanel; import javax.swing.ToolTipManager; +import jalview.api.RotatableCanvasI; +import jalview.datamodel.Point; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; +import jalview.datamodel.SequencePoint; +import jalview.math.RotatableMatrix; +import jalview.math.RotatableMatrix.Axis; +import jalview.util.ColorUtils; +import jalview.util.MessageManager; +import jalview.viewmodel.AlignmentViewport; + /** * Models a Panel on which a set of points, and optionally x/y/z axes, can be * drawn, and rotated or zoomed with the mouse @@ -322,16 +322,16 @@ public class RotatableCanvas extends JPanel int midX = getWidth() / 2; int midY = getHeight() / 2; - float maxWidth = Math.max(Math.abs(seqMax[0] - seqMin[0]), - Math.abs(seqMax[1] - seqMin[1])); + // float maxWidth = Math.max(Math.abs(seqMax[0] - seqMin[0]), + // Math.abs(seqMax[1] - seqMin[1])); int pix = Math.min(getWidth(), getHeight()); - float scaleBy = pix * getScaleFactor() / (2f * maxWidth); + float scaleBy = pix * getScaleFactor() / (2f); for (int i = 0; i < DIMS; i++) { g.drawLine(midX, midY, - midX + (int) (getAxisEndPoints()[i].x * scaleBy * seqMax[0]), - midY + (int) (getAxisEndPoints()[i].y * scaleBy * seqMax[1])); + midX + (int) (getAxisEndPoints()[i].x * scaleBy * 0.25), + midY + (int) (getAxisEndPoints()[i].y * scaleBy * 0.25)); } } -- 1.7.10.2