Skip to content

Commit

Permalink
Adapt the scale method (reset scale to 1 after each change).
Browse files Browse the repository at this point in the history
  • Loading branch information
mtiessen1175 committed Nov 22, 2024
1 parent baf6cce commit 617469b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/public/assets/scripts/annotations.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/public/assets/scripts/volumes.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"/assets/scripts/main.js": "/assets/scripts/main.js?id=5d75e90309015b8aad9b612f52a6979f",
"/assets/scripts/volumes.js": "/assets/scripts/volumes.js?id=ead6c2afb75060312c61a6d68ad4b28d",
"/assets/scripts/annotations.js": "/assets/scripts/annotations.js?id=4c1eb02d73360d78996dd306466b2d38",
"/assets/styles/main.css": "/assets/styles/main.css?id=bf09d95dc04208c3ee738dafbf8e123c"
}
"/assets/scripts/volumes.js": "/assets/scripts/volumes.js?id=f487d8fe79d9ae5c2eb5c53edc02c374",
"/assets/scripts/annotations.js": "/assets/scripts/annotations.js?id=305559ed397c61a8e6f2a2e1bbba4fea",
"/assets/styles/main.css": "/assets/styles/main.css?id=b692ef8518741236ded072068dddeb05"
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export default {
} else {
// call method to update layer scale
this.handleRenderEvents(this.layer, this.scale, null);
// reset scale to 1.0 after it has been modified
this.scale = 1.0;
this.map.getInteractions().forEach((interaction) => {
if (interaction.get('name') === 'mousewheelzoom') {
interaction.setActive(true);
Expand Down Expand Up @@ -162,7 +164,6 @@ export default {
}
if(scale !== null) {
ctx.scale(scale, scale, canvasPixel);
this.$nextTick();
}
ctx.translate(-canvasPixel[0], -canvasPixel[1]);
});
Expand Down Expand Up @@ -298,12 +299,14 @@ export default {
// // mapLayer.changed();
// // mapLayer.getSource().refresh();
// // });
// layer.setOpacity(this.opacity);
// layer.setVisible(true);
// mapLayer.setOpacity(this.opacity);
// mapLayer.setVisible(true);
// }
// }
// });
// // if layer does not exist yet, add it to map
// this.map.renderSync();
// if layer does not exist yet, add it to map
// if(!layerExists) {
this.map.getLayers().removeAt(0);
this.map.getLayers().insertAt(0, this.layer);
Expand Down
2 changes: 1 addition & 1 deletion src/resources/views/annotationsSettingsTab.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
</div>
</collapse>
<button class="btn btn-default" title="Edit the scale of the context layer" v-on:click="toggleEditing" :class="{active:isEditing}"><span class="fa fa-pencil-alt" aria-hidden="true"></span> Edit</button>
<span>Scale </span>(<span v-text="scale"></span>)
<span v-if="scale !== 1.0"> <span>Scale </span>(<span v-text="scale"></span>)</span>
</div>
</component>

0 comments on commit 617469b

Please sign in to comment.