@aurigma/design-atoms-text
Advanced tools
Comparing version 6.21.10 to 6.22.0
export declare enum TextFrameType { | ||
pointTextFrame = 0, | ||
pathTextFrame = 1, | ||
shapeTextFrame = 2 | ||
shapeTextFrame = 2, | ||
archedTextFrame = 3 | ||
} |
@@ -6,2 +6,3 @@ export var TextFrameType; | ||
TextFrameType[TextFrameType["shapeTextFrame"] = 2] = "shapeTextFrame"; | ||
TextFrameType[TextFrameType["archedTextFrame"] = 3] = "archedTextFrame"; | ||
})(TextFrameType || (TextFrameType = {})); |
import { Path, PointF } from "@aurigma/design-atoms-model/Math"; | ||
import { TextFrameType } from "../Enums"; | ||
import { IArchedFrameData } from "./IArchedFrameData"; | ||
export interface ITextFrameData { | ||
type: TextFrameType; | ||
frames: (Path | PointF)[]; | ||
frames: (Path | PointF | IArchedFrameData)[]; | ||
} |
@@ -338,2 +338,4 @@ import { EventObject } from "@aurigma/design-atoms-model/EventObject"; | ||
_drawCursor(isForce = false) { | ||
if (!this._isActive) | ||
return; | ||
const isSelectionActive = this._textManager.getSelectedTextRange() != null; | ||
@@ -340,0 +342,0 @@ this._renderManager.drawCursor(isSelectionActive, isForce); |
@@ -5,2 +5,3 @@ import { Path, PointF } from "@aurigma/design-atoms-model/Math"; | ||
import { ITextMeasurerHolder, ITextWhizzHolder } from "../Interfaces"; | ||
import { IArchedFrameData } from "../Interfaces/IArchedFrameData"; | ||
export declare class TextWhizzFrame { | ||
@@ -11,4 +12,5 @@ private readonly _tw; | ||
private readonly _textFrame; | ||
constructor(tw: ITextWhizzHolder, textMeasurerHolder: ITextMeasurerHolder, type: TextFrameType, data: Path | PointF, isMeasureFrame: boolean); | ||
constructor(tw: ITextWhizzHolder, textMeasurerHolder: ITextMeasurerHolder, type: TextFrameType, data: Path | PointF | IArchedFrameData, isMeasureFrame: boolean); | ||
get(): TextWhizz.TextFrame; | ||
private _getArchedTextFrame; | ||
private _getPointTextFrame; | ||
@@ -15,0 +17,0 @@ private _getPathTextFrame; |
@@ -21,2 +21,4 @@ import { EqualsOfFloatNumbers } from "@aurigma/design-atoms-model/Math"; | ||
break; | ||
case TextFrameType.archedTextFrame: | ||
this._textFrame = this._getArchedTextFrame(data); | ||
} | ||
@@ -28,2 +30,11 @@ } | ||
//#region - Frame generators - | ||
_getArchedTextFrame(data) { | ||
const frame = new this._tw.engine.ArchedTextFrame(); | ||
const scale = this._tw.initData.previewScale; | ||
if (!EqualsOfFloatNumbers(scale, 1)) | ||
data.point.scale(1 / scale, 1 / scale); | ||
frame.center = data.point; | ||
frame.bend = data.bend; | ||
return frame; | ||
} | ||
_getPointTextFrame(point) { | ||
@@ -75,4 +86,5 @@ const frame = new this._tw.engine.PointTextFrame(); | ||
} | ||
else | ||
else { | ||
frame.verticalAlignment = this._converter.convertVerticalAlignmentToTextWhizz(verticalAlignment); | ||
} | ||
if (overflowStrategy === OverflowStrategy.FitToBox) | ||
@@ -79,0 +91,0 @@ frame.copyFittingMode = this._tw.engine.CopyFittingMode.fitToBox; |
{ | ||
"name": "@aurigma/design-atoms-text", | ||
"version": "6.21.10", | ||
"version": "6.22.0", | ||
"description": "", | ||
@@ -37,3 +37,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@aurigma/design-atoms-model": "6.5.40", | ||
"@aurigma/design-atoms-model": "6.5.41", | ||
"@aurigma/text-whizz": "1.6.27", | ||
@@ -40,0 +40,0 @@ "xmldom": "^0.6.0" |
export enum TextFrameType { | ||
pointTextFrame, | ||
pathTextFrame, | ||
shapeTextFrame | ||
shapeTextFrame, | ||
archedTextFrame | ||
} |
import {Path, PointF} from "@aurigma/design-atoms-model/Math"; | ||
import {TextFrameType} from "../Enums"; | ||
import { IArchedFrameData } from "./IArchedFrameData"; | ||
export interface ITextFrameData { | ||
type: TextFrameType; | ||
frames: (Path | PointF)[]; | ||
frames: (Path | PointF | IArchedFrameData)[]; | ||
} |
@@ -479,2 +479,5 @@ import {EventObject} from "@aurigma/design-atoms-model/EventObject"; | ||
private _drawCursor(isForce = false) { | ||
if (!this._isActive) | ||
return; | ||
const isSelectionActive = this._textManager.getSelectedTextRange() != null; | ||
@@ -481,0 +484,0 @@ this._renderManager.drawCursor(isSelectionActive, isForce); |
@@ -8,2 +8,3 @@ import {EqualsOfFloatNumbers, Path, PointF} from "@aurigma/design-atoms-model/Math"; | ||
import {toTextWhizzPath} from "../../Utils/PathUtils"; | ||
import { IArchedFrameData } from "../Interfaces/IArchedFrameData"; | ||
@@ -21,3 +22,3 @@ export class TextWhizzFrame { | ||
type: TextFrameType, | ||
data: Path | PointF, | ||
data: Path | PointF | IArchedFrameData, | ||
isMeasureFrame: boolean) { | ||
@@ -39,2 +40,4 @@ | ||
break; | ||
case TextFrameType.archedTextFrame: | ||
this._textFrame = this._getArchedTextFrame(data as IArchedFrameData); | ||
} | ||
@@ -49,2 +52,14 @@ } | ||
private _getArchedTextFrame(data: IArchedFrameData): TextWhizz.ArchedTextFrame { | ||
const frame = new this._tw.engine.ArchedTextFrame(); | ||
const scale = this._tw.initData.previewScale; | ||
if (!EqualsOfFloatNumbers(scale, 1)) | ||
data.point.scale(1 / scale, 1 / scale); | ||
frame.center = data.point; | ||
frame.bend = data.bend; | ||
return frame; | ||
} | ||
private _getPointTextFrame(point: PointF): TextWhizz.PointTextFrame { | ||
@@ -108,4 +123,5 @@ const frame = new this._tw.engine.PointTextFrame(); | ||
frame.verticalAlignment = this._converter.convertVerticalAlignmentToTextWhizz(verticalAlignment); | ||
} else | ||
} else { | ||
frame.verticalAlignment = this._converter.convertVerticalAlignmentToTextWhizz(verticalAlignment); | ||
} | ||
@@ -112,0 +128,0 @@ if (overflowStrategy === OverflowStrategy.FitToBox) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1201987
586
28340