From 08714c31ee5202e01973baed9faba94e726cc0bc Mon Sep 17 00:00:00 2001 From: g00500048 Date: Wed, 20 Aug 2025 19:23:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DTextmodifier=20clip=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: g00500048 --- .../arkui-ohos/src/TextModifier.ts | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/TextModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/TextModifier.ts index 252b00422b0..c84f9b24291 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/TextModifier.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/TextModifier.ts @@ -73,6 +73,8 @@ export class TextModifier extends CommonMethodModifier implements TextAttribute, _copyOption0_value?: CopyOptions | undefined _draggable_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL _draggable0_value?: boolean | undefined + _textClip_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL + _textClip0_value?: boolean | undefined _textShadow_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL _textShadow0_value?: ShadowOptions | Array | undefined _heightAdaptivePolicy_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL @@ -479,6 +481,24 @@ export class TextModifier extends CommonMethodModifier implements TextAttribute, } } } + if (this._textClip_flag != AttributeUpdaterFlag.INITIAL) + { + switch (this._textClip_flag) { + case AttributeUpdaterFlag.UPDATE: { + peer.clip0Attribute((this._textClip0_value as boolean | undefined)); + this._textClip_flag = AttributeUpdaterFlag.RESET; + break; + } + case AttributeUpdaterFlag.SKIP: { + this._textClip_flag = AttributeUpdaterFlag.RESET; + break; + } + default: { + this._textClip_flag = AttributeUpdaterFlag.INITIAL; + peer.clip0Attribute(undefined); + } + } + } if (this._textShadow_flag != AttributeUpdaterFlag.INITIAL) { switch (this._textShadow_flag) { @@ -1161,6 +1181,19 @@ export class TextModifier extends CommonMethodModifier implements TextAttribute, } } } + if (modifier._textClip_flag != AttributeUpdaterFlag.INITIAL) + { + switch (modifier._textClip_flag) { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { + this.clip(modifier._textClip0_value); + break; + } + default: { + this.clip(undefined); + } + } + } if (modifier._textShadow_flag != AttributeUpdaterFlag.INITIAL) { switch (modifier._textShadow_flag) { @@ -1702,6 +1735,18 @@ export class TextModifier extends CommonMethodModifier implements TextAttribute, } return this } + clip(value: boolean | undefined): this { + if (((this._textClip_flag) == (AttributeUpdaterFlag.INITIAL)) || ((this._textClip0_value) !== (value))) + { + this._textClip_flag = AttributeUpdaterFlag.UPDATE + this._textClip0_value = value + } + else + { + this._textClip_flag = AttributeUpdaterFlag.SKIP + } + return this + } textShadow(value: ShadowOptions | Array | undefined): this { if (((this._textShadow_flag) == (AttributeUpdaterFlag.INITIAL)) || this._textShadow0_value !== value || !Type.of(value).isPrimitive()) { -- Gitee