mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-11 07:34:41 +08:00
Merge pull request #4904 from aignatov-bio/ai-sci-7822-fix-dimension-calculation
Fix label template logo dimension calculation [SCI-7822]
This commit is contained in:
commit
e2da83ee6e
2 changed files with 12 additions and 3 deletions
|
@ -35,6 +35,7 @@
|
|||
name: 'logoInsertModal',
|
||||
props: {
|
||||
unit: { type: String, required: true },
|
||||
density: { type: Number, required: true },
|
||||
dimension: { type: Array, required: true }
|
||||
},
|
||||
data() {
|
||||
|
@ -49,8 +50,15 @@
|
|||
$(this.$refs.modal).on('hidden.bs.modal', () => {
|
||||
this.$emit('cancel');
|
||||
});
|
||||
this.width = this.dimension[0]
|
||||
this.height = this.dimension[1]
|
||||
this.width = this.dimension[0] / this.density
|
||||
this.height = this.dimension[1] / this.density
|
||||
if (this.unit == 'in') {
|
||||
this.width = this.width / 25.4
|
||||
this.height = this.height / 25.4
|
||||
}
|
||||
|
||||
this.width = Math.round(this.width * 100) / 100
|
||||
this.height = Math.round(this.height * 100) / 100
|
||||
this.ratio = this.dimension[0] / this.dimension[1]
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
</div>
|
||||
<LogoInsertModal v-if="openLogoModal"
|
||||
:unit="labelTemplate.attributes.unit"
|
||||
:density="labelTemplate.attributes.density"
|
||||
:dimension="logoDimension"
|
||||
@insert:tag="insertTag"
|
||||
@cancel="openLogoModal = false"/>
|
||||
|
@ -138,7 +139,7 @@
|
|||
value.key = this.i18n.t(`label_templates.default_columns.${value.key}`)
|
||||
return value;
|
||||
});
|
||||
|
||||
|
||||
this.fields = result;
|
||||
this.$nextTick(() => {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
|
|
Loading…
Add table
Reference in a new issue