@leapfrog/interactive-canvas 1.14.0-beta.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -489,6 +489,8 @@ var StackObjectsLayoutFunction = /** @class */ (function () {
|
|
|
489
489
|
return;
|
|
490
490
|
if (object.getType() === ObjectType.TEXT && object.isBulleted())
|
|
491
491
|
actualWidth -= object.getBulletMargin();
|
|
492
|
+
if (object.getType() === ObjectType.TEXT && object.isOrderedList())
|
|
493
|
+
actualWidth -= object.getOrderedListMargin();
|
|
492
494
|
object.setPosition({
|
|
493
495
|
width: actualWidth
|
|
494
496
|
});
|
|
@@ -2532,7 +2534,7 @@ var Text = /** @class */ (function (_super) {
|
|
|
2532
2534
|
}
|
|
2533
2535
|
var currentLineNumbers = fabricText._currentLineNumbers;
|
|
2534
2536
|
if (currentLineNumbers && currentLineNumbers[lineIndex]) {
|
|
2535
|
-
var
|
|
2537
|
+
var entry = currentLineNumbers[lineIndex];
|
|
2536
2538
|
var fontSize = this.getValueOfPropertyAt(lineIndex, 0, "fontSize");
|
|
2537
2539
|
var fontFamily = this.getValueOfPropertyAt(lineIndex, 0, "fontFamily");
|
|
2538
2540
|
var color = this.getValueOfPropertyAt(lineIndex, 0, "fill");
|
|
@@ -2542,14 +2544,19 @@ var Text = /** @class */ (function (_super) {
|
|
|
2542
2544
|
var yShift = (fabricText.height / 2) + top - fontSize - 1;
|
|
2543
2545
|
var xOffset = (xShift * Math.cos(theta)) - (yShift * Math.sin(theta));
|
|
2544
2546
|
var yOffset = (xShift * Math.sin(theta)) + (yShift * Math.cos(theta));
|
|
2545
|
-
lineNumber
|
|
2547
|
+
var lineNumber = 1;
|
|
2548
|
+
for (var i = 0; i < lineIndex; i++) {
|
|
2549
|
+
if (currentLineNumbers[i])
|
|
2550
|
+
lineNumber++;
|
|
2551
|
+
}
|
|
2552
|
+
entry.set({
|
|
2546
2553
|
fontSize: fontSize,
|
|
2547
2554
|
fontFamily: fontFamily,
|
|
2548
2555
|
fill: color,
|
|
2549
2556
|
left: fabricText.left + xOffset,
|
|
2550
2557
|
top: fabricText.top + yOffset,
|
|
2551
2558
|
angle: fabricText.angle,
|
|
2552
|
-
text:
|
|
2559
|
+
text: lineNumber + "."
|
|
2553
2560
|
});
|
|
2554
2561
|
}
|
|
2555
2562
|
originalRenderTextLine.apply(fabricText, [method, ctx, line, left, top, lineIndex]);
|
|
@@ -491,6 +491,8 @@ var StackObjectsLayoutFunction = /** @class */ (function () {
|
|
|
491
491
|
return;
|
|
492
492
|
if (object.getType() === exports.ObjectType.TEXT && object.isBulleted())
|
|
493
493
|
actualWidth -= object.getBulletMargin();
|
|
494
|
+
if (object.getType() === exports.ObjectType.TEXT && object.isOrderedList())
|
|
495
|
+
actualWidth -= object.getOrderedListMargin();
|
|
494
496
|
object.setPosition({
|
|
495
497
|
width: actualWidth
|
|
496
498
|
});
|
|
@@ -2534,7 +2536,7 @@ var Text = /** @class */ (function (_super) {
|
|
|
2534
2536
|
}
|
|
2535
2537
|
var currentLineNumbers = fabricText._currentLineNumbers;
|
|
2536
2538
|
if (currentLineNumbers && currentLineNumbers[lineIndex]) {
|
|
2537
|
-
var
|
|
2539
|
+
var entry = currentLineNumbers[lineIndex];
|
|
2538
2540
|
var fontSize = this.getValueOfPropertyAt(lineIndex, 0, "fontSize");
|
|
2539
2541
|
var fontFamily = this.getValueOfPropertyAt(lineIndex, 0, "fontFamily");
|
|
2540
2542
|
var color = this.getValueOfPropertyAt(lineIndex, 0, "fill");
|
|
@@ -2544,14 +2546,19 @@ var Text = /** @class */ (function (_super) {
|
|
|
2544
2546
|
var yShift = (fabricText.height / 2) + top - fontSize - 1;
|
|
2545
2547
|
var xOffset = (xShift * Math.cos(theta)) - (yShift * Math.sin(theta));
|
|
2546
2548
|
var yOffset = (xShift * Math.sin(theta)) + (yShift * Math.cos(theta));
|
|
2547
|
-
lineNumber
|
|
2549
|
+
var lineNumber = 1;
|
|
2550
|
+
for (var i = 0; i < lineIndex; i++) {
|
|
2551
|
+
if (currentLineNumbers[i])
|
|
2552
|
+
lineNumber++;
|
|
2553
|
+
}
|
|
2554
|
+
entry.set({
|
|
2548
2555
|
fontSize: fontSize,
|
|
2549
2556
|
fontFamily: fontFamily,
|
|
2550
2557
|
fill: color,
|
|
2551
2558
|
left: fabricText.left + xOffset,
|
|
2552
2559
|
top: fabricText.top + yOffset,
|
|
2553
2560
|
angle: fabricText.angle,
|
|
2554
|
-
text:
|
|
2561
|
+
text: lineNumber + "."
|
|
2555
2562
|
});
|
|
2556
2563
|
}
|
|
2557
2564
|
originalRenderTextLine.apply(fabricText, [method, ctx, line, left, top, lineIndex]);
|