From 3ba5bb22f27079bd43b7a43d9e89b127c80332bf Mon Sep 17 00:00:00 2001 From: crschmidt Date: Mon, 28 Jul 2008 21:10:57 +0000 Subject: [PATCH] Confirmed with Tim Coulter that forcing the reflow here leads to a cleaner refresh on FF2-based browsers. FF3 seems unaffected either way, as does Safari. (Closes #1390) git-svn-id: http://svn.openlayers.org/trunk/openlayers@7578 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/Vector.js | 11 ++++--- tests/manual/reflow.html | 59 ++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 tests/manual/reflow.html diff --git a/lib/OpenLayers/Layer/Vector.js b/lib/OpenLayers/Layer/Vector.js index 0674ec48c0..df6406715c 100644 --- a/lib/OpenLayers/Layer/Vector.js +++ b/lib/OpenLayers/Layer/Vector.js @@ -290,10 +290,6 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, { if (!dragging) { this.renderer.root.style.visibility = "hidden"; - // force a reflow on gecko based browsers to actually hide the svg - if (navigator.userAgent.toLowerCase().indexOf("gecko") != -1) { - this.div.scrollLeft = this.div.scrollLeft; - } this.div.style.left = -parseInt(this.map.layerContainerDiv.style.left) + "px"; this.div.style.top = -parseInt(this.map.layerContainerDiv.style.top) + "px"; @@ -301,6 +297,13 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, { this.renderer.setExtent(extent); this.renderer.root.style.visibility = "visible"; + + // Force a reflow on gecko based browsers to prevent jump/flicker. + // This seems to happen on only certain configurations; it was originally + // noticed in FF 2.0 and Linux. + if (navigator.userAgent.toLowerCase().indexOf("gecko") != -1) { + this.div.scrollLeft = this.div.scrollLeft; + } } if (!this.drawn || zoomChanged) { diff --git a/tests/manual/reflow.html b/tests/manual/reflow.html new file mode 100644 index 0000000000..bb9585e763 --- /dev/null +++ b/tests/manual/reflow.html @@ -0,0 +1,59 @@ + + + + + + + +
+

Use the pan buttons. See flicker at end of animated pan.

+ +