mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-04-18 17:48:52 +08:00
fix: TextContent 的行高问题
This commit is contained in:
parent
bca679d4b1
commit
72f02726ba
@ -113,7 +113,11 @@ export class Text extends RenderItem<ETextEvent> {
|
|||||||
this.measure();
|
this.measure();
|
||||||
this.length = width;
|
this.length = width;
|
||||||
this.descent = actualBoundingBoxAscent;
|
this.descent = actualBoundingBoxAscent;
|
||||||
this.size(width, actualBoundingBoxAscent + actualBoundingBoxDescent);
|
this.size(
|
||||||
|
width,
|
||||||
|
Math.abs(actualBoundingBoxAscent) +
|
||||||
|
Math.abs(actualBoundingBoxDescent)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected handleProps(
|
protected handleProps(
|
||||||
|
@ -877,7 +877,8 @@ export class TextContentParser {
|
|||||||
|
|
||||||
private getHeight(metrics: TextMetrics) {
|
private getHeight(metrics: TextMetrics) {
|
||||||
return (
|
return (
|
||||||
metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent
|
Math.abs(metrics.actualBoundingBoxAscent) +
|
||||||
|
Math.abs(metrics.actualBoundingBoxDescent)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -966,6 +967,9 @@ export class TextContentParser {
|
|||||||
if (metrics.width > width) {
|
if (metrics.width > width) {
|
||||||
end = mid;
|
end = mid;
|
||||||
} else if (metrics.width === width) {
|
} else if (metrics.width === width) {
|
||||||
|
if (height > this.lineHeight) {
|
||||||
|
this.lineHeight = height;
|
||||||
|
}
|
||||||
return mid;
|
return mid;
|
||||||
} else {
|
} else {
|
||||||
start = mid;
|
start = mid;
|
||||||
|
Loading…
Reference in New Issue
Block a user