Skip to content

Commit

Permalink
Add text size
Browse files Browse the repository at this point in the history
  • Loading branch information
NiTrO_FuN committed Nov 15, 2023
1 parent f721a85 commit 5b92d95
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/components/CodeShower.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,15 @@ if(first() | duped() | dupefinished()) {
if(shape.angle) {
text+=`
EGP:egpAngle(${i+1},${shape.angle})`
}
} //Size
if(shape.strokeWidth && shape.strokeWidth>1 && !shape.filled) {
text+=`
EGP:egpSize(${i+1},${shape.strokeWidth})`
}
if(shape.fontSize) {
text+=`
EGP:egpSize(${i+1},${shape.fontSize})`
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/CreationZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default {
refreshCanva(dirty) {
if(dirty) {this.selectedShape.set("dirty",true)}
this.$refs.canva.refreshCanva()
this.selectedShape.set("dirty",false)
if(dirty){this.selectedShape.set("dirty",false)}
this.refreshCode(this.$refs.canva.canvas.getObjects())
},
refreshCode(shapes) {
Expand Down
3 changes: 3 additions & 0 deletions src/components/EGPCreation/CanvaVue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@
top: 0, left:0,
fill: 'rgba(255,255,255,1)',
filled: true,
fontSize: 20,
fontFamily: "Tahoma",
fontWeigth: "bold",
hasControls: false,
}
)
Expand Down
12 changes: 11 additions & 1 deletion src/components/EGPCreation/ShapeEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
<q-separator v-if="isText" dark inset spaced />
<div v-if="isText" class="row items-center justify-between text-white">
{{$t("alignment")}}
<div class="row justify-around col-grow items-center">
<div class="row justify-evenly col-grow items-center">
<q-option-group class="text-align-wrapper" dark dense v-model="originX" :options="hAlign" color="primary" inline @update:model-value="this.$emit('change-selected')"/>
<q-option-group class="text-align-wrapper" dark dense v-model="originY" :options="vAlign" color="primary" @update:model-value="this.$emit('change-selected')"/>
<q-input dark debounce="200" filled style="max-width: 150px;" v-model.number="fontSize" type="number" :label="$t('fontSize')" @update:model-value="this.$emit('change-selected')"/>
</div>
</div>
<q-separator dark inset spaced />
Expand Down Expand Up @@ -152,6 +153,15 @@ export default {
this.shape.set("strokeWidth",value)
}
},
fontSize: {
get () {
return this.shape.fontSize
},
set (value) {
if(!this.shape){return}
this.shape.set("fontSize",value)
}
},
rx: {
get () {
return this.shape.rx
Expand Down
2 changes: 2 additions & 0 deletions src/localisation/loc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default {
position: "Position",
points: "Points",
size: "Size",
fontSize: "Text size",
alignment: "Alignment",
radii: "Radii",
width: "Width",
Expand Down Expand Up @@ -65,6 +66,7 @@ export default {
position: "Position",
points: "Points",
size: "Taille",
fontSize: "Taille du texte",
alignment: "Alignement",
radii: "Rayons",
width: "Largeur",
Expand Down

0 comments on commit 5b92d95

Please sign in to comment.