Commit e31283c0 authored by Robin Tissot's avatar Robin Tissot
Browse files

Fixes next/previous page breaking segmentation panel (because the binary image fix).

parent ab1abac9
......@@ -5,8 +5,10 @@ const BasePanel = Vue.extend({
ratio: 1
};
},
updated() {
if (this.part.loaded) this.refresh();
watch: {
'ratio': function(n, o) {
if (this.part.loaded) this.refresh();
}
},
methods: {
setRatio() {
......
......@@ -116,6 +116,7 @@ const SegPanel = BasePanel.extend({
},
imageSrc() {
// empty the src to make sure the complete event gets fired
// this.$img.src = '';
if (!this.part.loaded) return '';
// overrides imageSrc to deal with color modes
// Note: vue.js doesn't have super call wtf we need to copy the code :(
......@@ -144,6 +145,12 @@ const SegPanel = BasePanel.extend({
this.refreshHistoryBtns();
}
},
'colorMode': function(n, o) {
this.$parent.prefetchImage(this.imageSrc, function(src) {
this.$img.src = src;
this.refreshSegmenter();
}.bind(this));
},
'fullsizeimage': function(n, o) {
// it was prefetched
if (n && n != o) {
......@@ -194,7 +201,6 @@ const SegPanel = BasePanel.extend({
updateView() {
this.segmenter.refresh();
},
// undo manager helpers
bulkCreate(data, createInEditor=false) {
if (data.regions && data.regions.length) {
......
......@@ -190,6 +190,7 @@ var partVM = new Vue({
let img = new Image();
img.addEventListener('load', function() {
if (callback) callback(src);
img.remove();
}.bind(this));
img.src = src;
},
......
......@@ -316,7 +316,7 @@
v-bind:key="'sL' + line.pk"/>
</div>
<img class="panel-img" v-bind:src="imageSrc"/>
<img class="panel-img"/>
{# TODO: make line overlay component #}
<div id="segmentation-overlay" class="overlay panel-overlay">
<svg width="100%" height="100%">
......
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