customized-fabric 1.8.5 → 1.8.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,7 @@ export declare const toCalendarObject: (object: Calendar) => {
18
18
  titleAlignment: string | undefined;
19
19
  titleColor: string | undefined;
20
20
  titleFontUrl: string | undefined;
21
+ letterCase: string | undefined;
21
22
  dayColor: string | undefined;
22
23
  dayFontUrl: string | undefined;
23
24
  markerColor: string | undefined;
@@ -40,6 +41,7 @@ export default class Calendar extends fabric.Group {
40
41
  calendarTitleAlignment?: string;
41
42
  calendarTitleColor?: string;
42
43
  calendarTitleFontUrl?: string;
44
+ calendarLetterCase?: string;
43
45
  calendarDayColor?: string;
44
46
  calendarDayFontUrl?: string;
45
47
  calendarMarkerColor?: string;
@@ -111,6 +111,7 @@ const CalendarClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
111
111
  titleAlignment: this?.calendarTitleAlignment,
112
112
  titleColor: this?.calendarTitleColor,
113
113
  titleFontUrl: this?.calendarTitleFontUrl,
114
+ letterCase: this?.calendarLetterCase,
114
115
  dayColor: this?.calendarDayColor,
115
116
  dayFontUrl: this?.calendarDayFontUrl,
116
117
  markerColor: this?.calendarMarkerColor,
@@ -137,6 +138,7 @@ const toCalendarObject = (object) => {
137
138
  titleAlignment: object?.calendarTitleAlignment,
138
139
  titleColor: object?.calendarTitleColor,
139
140
  titleFontUrl: object?.calendarTitleFontUrl,
141
+ letterCase: object?.calendarLetterCase,
140
142
  dayColor: object?.calendarDayColor,
141
143
  dayFontUrl: object?.calendarDayFontUrl,
142
144
  markerColor: object?.calendarMarkerColor,
@@ -6,6 +6,7 @@ export interface CalendarSettings {
6
6
  titleAlignment?: string;
7
7
  titleColor?: string;
8
8
  titleFontUrl?: string;
9
+ letterCase?: string;
9
10
  dayColor?: string;
10
11
  dayFontUrl?: string;
11
12
  markerColor?: string;
@@ -30,6 +30,8 @@ export declare const toTextInputObject: (object: TextInput) => {
30
30
  infix: any;
31
31
  suffix: any;
32
32
  isAllCapital: any;
33
+ lineHeight: number | undefined;
34
+ charSpacing: number | undefined;
33
35
  };
34
36
  };
35
37
  export default class TextInput extends fabric.Group {
@@ -69,22 +69,24 @@ const TextInputClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
69
69
  this.fire("scaling");
70
70
  },
71
71
  autoChangeFontSize: function (changeSpeed) {
72
- if (this.width <= this.textObject.__lineWidths ||
73
- this.height <= this.textObject.height) {
74
- while (this.width <= this.textObject.__lineWidths ||
72
+ let maxLineWidth = Math.max(...this.textObject.__lineWidths);
73
+ if (this.width <= maxLineWidth || this.height <= this.textObject.height) {
74
+ while (this.width <= maxLineWidth ||
75
75
  this.height <= this.textObject.height) {
76
76
  this.textObject.set({
77
77
  fontSize: this.textObject.fontSize - changeSpeed,
78
78
  });
79
+ maxLineWidth = Math.max(...this.textObject.__lineWidths);
79
80
  }
80
81
  }
81
82
  else {
82
83
  while (this.textObject.maxFontSize > this.textObject.fontSize &&
83
- this.width > this.textObject.__lineWidths &&
84
+ this.width > maxLineWidth &&
84
85
  this.height > this.textObject.height) {
85
86
  this.textObject.set({
86
87
  fontSize: this.textObject.fontSize + changeSpeed,
87
88
  });
89
+ maxLineWidth = Math.max(...this.textObject.__lineWidths);
88
90
  }
89
91
  }
90
92
  },
@@ -126,8 +128,8 @@ const TextInputClass = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
126
128
  this.textObject.set({
127
129
  fontSize,
128
130
  });
129
- if (this.textObject.__lineWidths < this.width &&
130
- this.textObject.height < this.height) {
131
+ const maxLineWidth = Math.max(...this.textObject.__lineWidths);
132
+ if (maxLineWidth < this.width && this.textObject.height < this.height) {
131
133
  }
132
134
  else {
133
135
  this.autoChangeFontSize(1);
@@ -209,6 +211,8 @@ const toTextInputObject = (object) => {
209
211
  infix: textObject?.infix,
210
212
  suffix: textObject?.suffix,
211
213
  isAllCapital: textObject?.isAllCapital,
214
+ lineHeight: textObject?.lineHeight,
215
+ charSpacing: textObject?.charSpacing,
212
216
  },
213
217
  };
214
218
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "customized-fabric",
3
- "version": "1.8.5",
3
+ "version": "1.8.7",
4
4
  "description": "Customized fabric",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",