diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/widgets/preview/PreviewPanel.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/widgets/preview/PreviewPanel.java index 2cf10c13d..67189d9c8 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/widgets/preview/PreviewPanel.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/widgets/preview/PreviewPanel.java @@ -165,7 +165,8 @@ protected void doResize() { media = null; mail = null; reload = null; - } else if (!redrawing && (width != getWidth() || height != getHeight())) { +// } else if (!redrawing && (width != getWidth() || height != getHeight())) { + } else if (!redrawing && (!isWithinTolerance(width, getWidth(),10) || !isWithinTolerance(height, getHeight(),10))) { width = getWidth(); height = getHeight(); clearContent(); @@ -173,6 +174,10 @@ protected void doResize() { } } + private boolean isWithinTolerance(int value, int targetValue, int tolerance) { + return value >= targetValue - tolerance && value <= targetValue + tolerance; + } + @Override public synchronized void redraw() { redrawing = true;