Another paranoid attempt to avoid Wildfire problem

git-svn-id: https://zxing.googlecode.com/svn/trunk@1641 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2010-11-11 16:15:35 +00:00
parent 20cac4ff82
commit 5798f40398

View file

@ -119,21 +119,25 @@ public final class ViewfinderView extends View {
lastPossibleResultPoints = currentPossible; lastPossibleResultPoints = currentPossible;
paint.setAlpha(OPAQUE); paint.setAlpha(OPAQUE);
paint.setColor(resultPointColor); paint.setColor(resultPointColor);
synchronized (currentPossible) {
for (ResultPoint point : currentPossible) { for (ResultPoint point : currentPossible) {
canvas.drawCircle(frame.left + (int) (point.getX() * scaleX), canvas.drawCircle(frame.left + (int) (point.getX() * scaleX),
frame.top + (int) (point.getY() * scaleY), frame.top + (int) (point.getY() * scaleY),
6.0f, paint); 6.0f, paint);
} }
} }
}
if (currentLast != null) { if (currentLast != null) {
paint.setAlpha(OPAQUE / 2); paint.setAlpha(OPAQUE / 2);
paint.setColor(resultPointColor); paint.setColor(resultPointColor);
synchronized (currentLast) {
for (ResultPoint point : currentLast) { for (ResultPoint point : currentLast) {
canvas.drawCircle(frame.left + (int) (point.getX() * scaleX), canvas.drawCircle(frame.left + (int) (point.getX() * scaleX),
frame.top + (int) (point.getY() * scaleY), frame.top + (int) (point.getY() * scaleY),
3.0f, paint); 3.0f, paint);
} }
} }
}
// Request another update at the animation interval, but only repaint the laser line, // Request another update at the animation interval, but only repaint the laser line,
// not the entire viewfinder mask. // not the entire viewfinder mask.
@ -157,7 +161,9 @@ public final class ViewfinderView extends View {
} }
public void addPossibleResultPoint(ResultPoint point) { public void addPossibleResultPoint(ResultPoint point) {
synchronized (possibleResultPoints) {
possibleResultPoints.add(point); possibleResultPoints.add(point);
} }
}
} }