Skip to content

Commit

Permalink
add: min font size
Browse files Browse the repository at this point in the history
  • Loading branch information
xpadev-net committed Nov 2, 2023
1 parent b60ad93 commit cd86fd5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/objects/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class IrText extends IrObject {
const size = this.options.size * this.options.scale;
this.__reverse = size < 0;
if (Math.abs(size) < 10) {
this.__scale = Math.abs(size / 10);
this.__scale = Math.max(Math.abs(size / 10), 0.16);
this.__size = 10;
} else {
this.__scale = 1;
Expand All @@ -90,7 +90,7 @@ class IrText extends IrObject {
}
const size = Math.abs(val * this.options.scale);
if (size < 10) {
this.__scale = size / 10;
this.__scale = Math.max(size / 10, 0.16);
this.__size = 10;
} else if (size > 100 && val >= 3) {
this.__scale = size / 100;
Expand Down Expand Up @@ -132,7 +132,7 @@ class IrText extends IrObject {
const size = Math.abs(val * this.options.size);
this.__reverse = val < 0;
if (size < 10) {
this.__scale = size / 10;
this.__scale = Math.max(size / 10, 0.16);
this.__size = 10;
} else if (size > 100 && this.options.size >= 3) {
this.__scale = size / 100;
Expand Down Expand Up @@ -177,7 +177,7 @@ class IrText extends IrObject {
__measure() {
const size = Math.abs(this.size * this.scale);
if (size < 10) {
this.__scale = size / 10;
this.__scale = Math.max(size / 10, 0.16);
this.__size = 10;
} else if (size > 100 && this.size >= 3) {
this.__scale = size / 100;
Expand Down

0 comments on commit cd86fd5

Please sign in to comment.