
|
If you were logged in you would be able to see more operations.
|
|
|
|
Reason for the problem is an error in the colour-calculation in org.esa.beam.glayer.PlacemarkLayer.
(actually only the first part of the summary is a bug, the second part of this ticket is a feature, but as both are minor changes affecting the same method, I'm submitting them in one ticket)
The current code in Placemark layer calculates an RGBA colour value using RGGA values in drawTextLabel(). The code in question is
Color selectionColor = new Color(getTextBgColor().getRed(),
getTextBgColor().getGreen(),
__getTextBgColor().getGreen()__,
alphas[i]);
Also, usage of BasicStroke could be more specific. The current implementation is:
int[] alphas = new int[]{64, 128, 192, 255};
for (int i = 0; i < alphas.length; i++) {
BasicStroke selectionStroke = new BasicStroke((alphas.length - i));
......
}
Suggestion is to change two aspects:
* make maxStrokeWidth different from alphas.length
* use specific end- and join-style for BasicStroke instead of default (given suggestion looks nicer on linux - at least on my box - but should provide the same behaviour on all platforms.)
int[] alphas = new int[]{64, 128, 192, 255};
float maxStrokeWidth = 4.0f;
for (int i = 0; i < alphas.length; i++) {
float strokeWidth = maxStrokeWidth * (1.0f - (float) i / alphas.length);
BasicStroke selectionStroke = new BasicStroke(strokeWidth, BasicStroke.JOIN_ROUND, BasicStroke.CAP_ROUND);
....
}
...hoping the code examples will stay readable...
|
|
Description
|
Reason for the problem is an error in the colour-calculation in org.esa.beam.glayer.PlacemarkLayer.
(actually only the first part of the summary is a bug, the second part of this ticket is a feature, but as both are minor changes affecting the same method, I'm submitting them in one ticket)
The current code in Placemark layer calculates an RGBA colour value using RGGA values in drawTextLabel(). The code in question is
Color selectionColor = new Color(getTextBgColor().getRed(),
getTextBgColor().getGreen(),
__getTextBgColor().getGreen()__,
alphas[i]);
Also, usage of BasicStroke could be more specific. The current implementation is:
int[] alphas = new int[]{64, 128, 192, 255};
for (int i = 0; i < alphas.length; i++) {
BasicStroke selectionStroke = new BasicStroke((alphas.length - i));
......
}
Suggestion is to change two aspects:
* make maxStrokeWidth different from alphas.length
* use specific end- and join-style for BasicStroke instead of default (given suggestion looks nicer on linux - at least on my box - but should provide the same behaviour on all platforms.)
int[] alphas = new int[]{64, 128, 192, 255};
float maxStrokeWidth = 4.0f;
for (int i = 0; i < alphas.length; i++) {
float strokeWidth = maxStrokeWidth * (1.0f - (float) i / alphas.length);
BasicStroke selectionStroke = new BasicStroke(strokeWidth, BasicStroke.JOIN_ROUND, BasicStroke.CAP_ROUND);
....
}
...hoping the code examples will stay readable... |
Show » |
|