LGSInnovations/sigplot

Black rectangle in legend

kmun opened this issue · 3 comments

kmun commented

Describe the bug
When displaying a type 2000 file in 1D mode there is a black rectangle in the left side of the legend

To Reproduce

Steps to reproduce the behavior:
Create a plot
Set the Layer type as 1D (sigplot.Layer1D)
Plot a type 2000 file using overlay
Verify each element in the 2000 file is displayed, i.e. if it's 4 deep that 4 color traces appear
Press the L in the upper right corner
Verify that all the elements are indicated in the legend with a .001,.002 suffix.
See that there is a black rectangle in the left side of the legend covering the first part of the name of the file. The rectangle gets taller as there are more entries. Around the first 8 characters of the names are covered, as well as the colored lines. IF YOU TOGGLE OFF all of the elements in the file, the black rectangle goes away. Toggling back on one of the elements makes the rectangle reappear.

Expected behavior
See that there is a black rectangle in the left side of the legend covering the first part of the name of the file. This is NOT shown in the penny.prm file on the sigplot web site under:

https://sigplot.lgsinnovations.com/sigplot-2.0/inaction.html

where it is a 1D representation of 2D data.

jsFiddle

None

Screenshots
None

Desktop (please complete the following information):
Same results with Microsoft Edge and Firefox

Smartphone (please complete the following information):
None

Additional context
None

Thanks. I can confirm that I am able to reproduce this issue and will get it fixed soon.

@kmun This bug was introduced in ef66bc5.

Basically there were three issues:

  1. the code incorrectly used the header class instead of looking at the layer type to determine if the line or color bar should be draw
  2. the code didn't draw the color bar in the legend correctly due to a typo, so it instead drew a blank box
  3. the colorbar legend box was not scaled correctly if there was more than one layer present.

After the fix I'm committing, things all look good.

image

image

Fixed in 4082976 (#58).