PAIR-code / megaplot

Apache License 2.0
19 stars 5 forks source link

Fix max/min size constraints for devicePixelRatio other than 2 #64

Closed jimbojw closed 1 year ago

jimbojw commented 1 year ago

The MaxSizePixel and MinSizePixel sprite attributes allow the API user to specify maximum and minimum sizes for the sprite. These bounds are applied after all other size computations, such as scaling and geometric zoom.

Currently however, these bounds assume a devicePixelRatio of 2. For other device pixel ratios, these values are scaled incorrectly.

Fix the application of max and min size pixel bounds to account for different devicePixelRatio values.