Commit 8068a352 authored by Jean Rabreau's avatar Jean Rabreau
Browse files

restore centerAndScale method

parent 5e799b5b
Pipeline #60596 passed with stages
in 4 minutes and 24 seconds
......@@ -59,7 +59,7 @@
position:absolute;
top:10px;
right:10px;
background-color:rgb(255, 255, 255, 0.1);
background-color:rgba(255, 255, 255, 0.1);
transition: opacity 1s ease;
opacity:1.0;
}
......
......@@ -247,8 +247,8 @@ centerAndScale: function(dt) {
const zoom = Math.pow(2, t.pos.z);
const scale = Math.max(zoom*(box[2]-box[0])/t.canvas.width, zoom*(box[3]-box[1])/t.canvas.height);
const z = Math.log(scale)/Math.LN2;
// t.setPosition(dt, (box[2] + box[0])/2, (box[3] + box[1])/2, z, t.pos.a);
t.setPosition(dt, 0, 0, 0, 0);
t.setPosition(dt, (box[2] + box[0])/2, (box[3] + box[1])/2, z, t.pos.a);
// t.setPosition(dt, 0, 0, 0, 0);
},
pan: function(dt, dx, dy) { //dx and dy expressed as pixels in the current size!
......
......@@ -108,7 +108,7 @@ const RelightViewer = function (div, options = {}) {
document.onmousewheel !== undefined ? "mousewheel" : // Webkit and IE support at least "mousewheel"
"DOMMouseScroll"; // older Firefox
t.canvas.addEventListener(support, function(e) { t.mousewheel(e); }, false);
window.addEventListener('resize', function(/*event*/) { t.resize(canvas.offsetWidth, canvas.offsetHeight); if(options.scale) t.updateScale(); t.updatePagemap(); });
window.addEventListener('resize', function(/*event*/) { const el = canvas.parentElement.parentElement; t.resize(el.offsetWidth, el.offsetHeight); if(options.scale) t.updateScale(); t.updatePagemap(); });
t.canvas.addEventListener('contextmenu', function(e) { e.preventDefault(); return false; });
......
......@@ -36,7 +36,7 @@ export default {
}],
fit: true,
bounded: true,
zbounded: true,
zbounded: false,
maxzoom: -4,
minzoom: 100,
pos: { x:0, y:0, z:0, a:0 },
......@@ -48,8 +48,8 @@ export default {
this.relightViewer = new RelightViewer('.relight', options)
const relightDiv = this.$el
this.relightViewer.resize(relightDiv.clientWidth, relightDiv.clientHeight)
const container = this.$el
this.relightViewer.resize(container.clientWidth, container.clientHeight)
},
}
</script>
......
......@@ -252,7 +252,7 @@ const Item = {
formData.append("Content-Type", file.type)
formData.append("file", file)
return authority.post(
`items/${itemId}/mediafiles/rti/`,
`items/${itemId}/mediafiles/upload_rti/`,
formData
).then(response => {
commit('ADD_MEDIA_FILE', response.data)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment