mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-153969 Change draw order of underline effect
This commit is contained in:
@@ -372,6 +372,10 @@ class EditorPainter implements TextDrawingCallback {
|
||||
@Override
|
||||
public void paint(Graphics2D g, VisualLineFragmentsIterator.Fragment fragment, int start, int end,
|
||||
TextAttributes attributes, float xStart, float xEnd, int y) {
|
||||
boolean allowBorder = fragment.getCurrentFoldRegion() != null;
|
||||
if (attributes != null && hasTextEffect(attributes.getEffectColor(), attributes.getEffectType(), allowBorder)) {
|
||||
paintTextEffect(g, xStart, xEnd, y, attributes.getEffectColor(), attributes.getEffectType(), allowBorder);
|
||||
}
|
||||
if (attributes != null && attributes.getForegroundColor() != null) {
|
||||
g.setColor(attributes.getForegroundColor());
|
||||
fragment.draw(g, xStart, y, start, end);
|
||||
@@ -384,10 +388,6 @@ class EditorPainter implements TextDrawingCallback {
|
||||
}
|
||||
paintWhitespace(g, text, xStart, y, start, end, whitespacePaintingStrategy, fragment, whiteSpaceStroke, whiteSpaceStrokeWidth);
|
||||
}
|
||||
boolean allowBorder = fragment.getCurrentFoldRegion() != null;
|
||||
if (attributes != null && hasTextEffect(attributes.getEffectColor(), attributes.getEffectType(), allowBorder)) {
|
||||
paintTextEffect(g, xStart, xEnd, y, attributes.getEffectColor(), attributes.getEffectType(), allowBorder);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -410,14 +410,12 @@ class EditorPainter implements TextDrawingCallback {
|
||||
|
||||
private float paintLineLayoutWithEffect(Graphics2D g, LineLayout layout, float x, float y,
|
||||
@Nullable Color effectColor, @Nullable EffectType effectType) {
|
||||
float initialX = x;
|
||||
if (hasTextEffect(effectColor, effectType, false)) {
|
||||
paintTextEffect(g, x, x + layout.getWidth(), (int)y, effectColor, effectType, false);
|
||||
}
|
||||
for (LineLayout.VisualFragment fragment : layout.getFragmentsInVisualOrder(x)) {
|
||||
fragment.draw(g, x, y);
|
||||
x = fragment.getEndX();
|
||||
|
||||
}
|
||||
if (hasTextEffect(effectColor, effectType, false)) {
|
||||
paintTextEffect(g, initialX, x, (int)y, effectColor, effectType, false);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user