g.setColor(Color.white);
g.fillRect(0, 0, visibleRect.width, visibleRect.height);
+ ViewportRanges ranges = av.getRanges();
+
+
+
if (image != null)
{
// BH 2018 optimizing generation of new Rectangle().
if (fastPaint || (visibleRect.width != (clipBounds = g.getClipBounds(clipBounds)).width)
|| (visibleRect.height != clipBounds.height))
{
-
-
g.drawImage(image, 0, 0, this);
fastPaint = false;
return;
}
}
- imgWidth = (av.getRanges().getEndRes() - av.getRanges().getStartRes()
+
+ imgWidth = (ranges.getEndRes() - ranges.getStartRes()
+ 1) * av.getCharWidth();
+
if (imgWidth < 1)
{
+ fastPaint = false;
return;
}
Graphics2D gg;
gg = (Graphics2D) image.getGraphics();
}
-
- drawComponent(gg, av.getRanges().getStartRes(),
+
+ drawComponent(gg, ranges.getStartRes(),
av.getRanges().getEndRes() + 1);
gg.dispose();
imageFresh = false;
}
/**
- * set true to enable redraw timing debug output on stderr
- */
- private final boolean debugRedraw = false;
-
- /**
* non-Thread safe repaint
*
* @param horizontal
int sr = av.getRanges().getStartRes();
int er = av.getRanges().getEndRes() + 1;
int transX = 0;
+
+ if (er == sr + 1) {
+ fastPaint = false;
+ return;
+ }
Graphics2D gg = (Graphics2D) image.getGraphics();