Skip to content

Commit 7dd819e

Browse files
committed
💄 Section巨大化后标题重叠视觉优化,添加半透明遮盖
1 parent 57ecf09 commit 7dd819e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/src/core/render/canvas2d/entityRenderer/section/SectionRenderer.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ export namespace SectionRenderer {
9393
if (Camera.currentScale < 0.2) {
9494
const fontSizeVector = getFontSizeBySectionSize(section);
9595
const fontHeight = fontSizeVector.y;
96+
ShapeRenderer.renderRect(
97+
new Rectangle(
98+
Renderer.transformWorld2View(section.rectangle.location),
99+
section.rectangle.size.multiply(Camera.currentScale),
100+
),
101+
section.color.a === 0
102+
? StageStyleManager.currentStyle.BackgroundColor.toNewAlpha(0.5)
103+
: section.color.toNewAlpha(0.5),
104+
StageStyleManager.currentStyle.StageObjectBorderColor,
105+
2 * Camera.currentScale,
106+
);
96107
// 缩放过小了,显示巨大化文字
97108
TextRenderer.renderTextFromCenter(
98109
section.text,

0 commit comments

Comments
 (0)