Skip to content

Commit 2bea3b3

Browse files
committed
examples/deepzoom: Initialize scalebar configuration only once
1 parent eaf515c commit 2bea3b3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

examples/deepzoom/templates/slide-multipane.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ <h1>Slide properties</h1>
134134
// from DZI XML.
135135
viewer.source.minLevel = 8;
136136
});
137+
viewer.scalebar({
138+
xOffset: 10,
139+
yOffset: 10,
140+
barThickness: 3,
141+
color: '#555555',
142+
fontColor: '#333333',
143+
backgroundColor: 'rgba(255, 255, 255, 0.5)',
144+
});
137145

138146
function open_slide(url, mpp) {
139147
var tile_source;
@@ -149,12 +157,6 @@ <h1>Slide properties</h1>
149157
viewer.open(tile_source);
150158
viewer.scalebar({
151159
pixelsPerMeter: mpp ? (1e6 / mpp) : 0,
152-
xOffset: 10,
153-
yOffset: 10,
154-
barThickness: 3,
155-
color: '#555555',
156-
fontColor: '#333333',
157-
backgroundColor: 'rgba(255, 255, 255, 0.5)',
158160
});
159161
}
160162

0 commit comments

Comments
 (0)