Changeset 35957 for main/trunk
- Timestamp:
- 2022-01-11T13:57:48+13:00 (2 years ago)
- Location:
- main/trunk/model-interfaces-dev/atea/ocr/src/components
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/ocr/src/components/MainPage.vue
r35956 r35957 294 294 <div class="main-content-columns"> 295 295 <ocr-image-display 296 v-if="!showThresholdedImage" 296 297 :imageUrl="imageUrl" 297 :thresholdedImageUrl="thresholdedImageUrl"298 298 :enableMagnifier="enableMagnifier" 299 :magnifierZoom="magnifierZoom" 300 :showThresholdedImage="showThresholdedImage" /> 299 :magnifierZoom="magnifierZoom" /> 300 301 <ocr-image-display 302 v-else 303 :imageUrl="thresholdedImageUrl" 304 :enableMagnifier="enableMagnifier" 305 :magnifierZoom="magnifierZoom" /> 301 306 302 307 <textarea -
main/trunk/model-interfaces-dev/atea/ocr/src/components/OcrImageDisplay.vue
r35956 r35957 6 6 props: { 7 7 imageUrl: String, 8 thresholdedImageUrl: String,9 8 enableMagnifier: Boolean, 10 magnifierZoom: Number, 11 showThresholdedImage: Boolean 9 magnifierZoom: Number 12 10 }, 13 11 data() { … … 123 121 imageUrl() { 124 122 setTimeout(() => { 125 this.updateMagnifier(this.$refs.ocrImage); 126 }, 100); 127 }, 128 thresholdedImageUrl() { 129 if (!this.showThresholdedImage) { 130 return; 131 } 132 133 setTimeout(() => { 134 this.updateMagnifier(this.$refs.thresholdedImage); 135 }, 100); 136 }, 137 showThresholdedImage(newValue) { 138 setTimeout(() => { 139 if (newValue) { 140 this.updateMagnifier(this.$refs.thresholdedImage); 141 } 142 else { 143 this.updateMagnifier(this.$refs.ocrImage); 144 } 123 this.updateMagnifier(this.$refs.imageRef); 145 124 }, 100); 146 125 }, 147 126 magnifierZoom() { 148 if (this.showThresholdedImage) { 149 this.updateMagnifier(this.$refs.thresholdedImage); 150 } 151 else { 152 this.updateMagnifier(this.$refs.ocrImage); 153 } 127 this.updateMagnifier(this.$refs.imageRef); 154 128 } 155 129 }, 156 130 mounted() { 157 131 setTimeout(() => { 158 this.updateMagnifier(this.$refs. ocrImage);132 this.updateMagnifier(this.$refs.imageRef); 159 133 }, 100); 160 134 } … … 163 137 164 138 <template> 165 <div ref="magContainer" class=" ocr-image-container">139 <div ref="magContainer" class="image-container"> 166 140 <div ref="magnifier" class="magnifier" @mousemove="moveMagnifier" :style="{ 'visibility': enableMagnifier ? 'visible' : 'collapse' }" /> 167 <img v-if="!showThresholdedImage" ref="ocrImage" class="ocr-image" :src="imageUrl" /> 168 <img v-if="showThresholdedImage" ref="thresholdedImage" class="ocr-image" :src="thresholdedImageUrl" /> 141 <img v-if="!showThresholdedImage" ref="imageRef" class="image" :src="imageUrl" /> 169 142 </div> 170 143 </template> 171 144 172 145 <style lang="scss" scoped> 173 . ocr-image-container {146 .image-container { 174 147 position: relative; 175 148 … … 189 162 } 190 163 191 . ocr-image {164 .image { 192 165 border: 1px solid #444; 193 166 max-width: 100%;
Note:
See TracChangeset
for help on using the changeset viewer.