mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-04-11 15:47:06 +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.length = width;
|
||||
this.descent = actualBoundingBoxAscent;
|
||||
this.size(width, actualBoundingBoxAscent + actualBoundingBoxDescent);
|
||||
this.size(
|
||||
width,
|
||||
Math.abs(actualBoundingBoxAscent) +
|
||||
Math.abs(actualBoundingBoxDescent)
|
||||
);
|
||||
}
|
||||
|
||||
protected handleProps(
|
||||
|
@ -877,7 +877,8 @@ export class TextContentParser {
|
||||
|
||||
private getHeight(metrics: TextMetrics) {
|
||||
return (
|
||||
metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent
|
||||
Math.abs(metrics.actualBoundingBoxAscent) +
|
||||
Math.abs(metrics.actualBoundingBoxDescent)
|
||||
);
|
||||
}
|
||||
|
||||
@ -966,6 +967,9 @@ export class TextContentParser {
|
||||
if (metrics.width > width) {
|
||||
end = mid;
|
||||
} else if (metrics.width === width) {
|
||||
if (height > this.lineHeight) {
|
||||
this.lineHeight = height;
|
||||
}
|
||||
return mid;
|
||||
} else {
|
||||
start = mid;
|
||||
|
Loading…
Reference in New Issue
Block a user