Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix background display on linear gauge vertical vs horizontal #15

Open
mcder017 opened this issue Aug 10, 2015 · 0 comments
Open

Fix background display on linear gauge vertical vs horizontal #15

mcder017 opened this issue Aug 10, 2015 · 0 comments

Comments

@mcder017
Copy link

On at least a smaller (20x60) vertical linear gauge, the black "background" image is visible starting much too high (relative to the scale and displayed value) and finishing much too low (relative to the scale and displayed value, which are in good alignment).

This appears to be due to magic numbers from AbstractLinear (line 1027 with 0.1276 and 0.7280 for a vertical gauge, & line 1032 with 0.139 and 0.735 for horizontal gauges) and Linear (see line 539/540 and 577/578 with slightly different magic numbers) not being used in BackgroundImageFactory which is using a fixed 16pixel & 32pixel offset in line 431.

Fixing the alignment (so that the magic numbers are used for the "alignment" direction of the rectangle, but the fixed offset is still used for the "other" axis of the rectangle) is complicated by BackgroundImageFactory not having a parameter to indicate horizontal vs. vertical alignment (to which the magic numbers are tied). I suspect the createLinearBackground function will need a new argument.

I believe there is a border image (still visible when setBackgroundVisible is set false) that outlines the background, that has the same alignment problem, but I haven't tracked down what function that is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant