Multiple export preview default size values are redundant

Issue #531 new
Robert Leach created an issue

USE CASE: WHAT DO YOU WANT TO DO?

Make the code easier to understand and more consistent.

STEPS TO REPRODUCE AN ISSUE (OR TRIGGER A NEW FEATURE)

n/a

CURRENT BEHAVIOR

Multiple static default size variables exist for creating the export preview image and are always ultimately not used.

EXPECTED BEHAVIOR

Only one dimension is really needed and that's the size of the square edge of the export preview area - possibly also a margin value. All other sizes related to the export preview dimensions should be derived from that.

DEVELOPERS ONLY SECTION

SUGGESTED CHANGE (Pseudocode optional)

There's really only 1 value that's needed, and that's the longer matrix edge. The length of the other dimension is determined as a fraction of the long value. Plus, they should all be the same value. In fact, I think there's a place in the label code where it refers to the tree code's static D_LONG value. The values here are arbitrary and in fact are almost certainly always changed. The size of the area where the preview is drawn is based on another number elsewhere, which I think is 450. Really, what should be happening, is that that number should be used to derive the longer scaled matrix edge length. The length of the tree and label edges would then be derived from that using ExportHandler. Re-write the code to only use the 450 value (the size of the square space that will hold the preview). Note that if a document format is selected, there's also a margin to consider.

FILES AFFECTED (where the changes will be implemented) - developers only

ExportPreviewLabels ExportPreviewTrees ExportPreviewMatrix ExportDialog

LEVEL OF EFFORT - developers only

medium

COMMENTS

Comments (0)

  1. Log in to comment