diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalAlpha.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalAlpha.ets index b63ceb827435d06b25b3973a76cd497322b91404..9f7951318e07ce3fdf90e101666a028340a63df3 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalAlpha.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasGlobalAlpha.ets @@ -43,6 +43,12 @@ struct SetCircle { }) .onActionUpdate((event: GestureEvent) => { this.X = event.offsetX; + this.context.globalAlpha = (this.X)*0.005; + this.context.fillStyle = 'rgb(255,0,0)'; + this.context.fillRect(150, 150, 50, 50); + this.context.globalAlpha = (this.X)*0.005; + this.context.fillStyle = 'rgb(0,0,255)'; + this.context.fillRect(200, 200, 50, 50); }) .onActionEnd(() => { console.info('Pan end'); @@ -59,9 +65,10 @@ struct SetCircle { .height('100%') .backgroundColor('#ffffffff') .onReady(() =>{ + this.context.globalAlpha = 0.05; this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillRect(150, 150, 50, 50); - this.context.globalAlpha = (this.X)*0.005; + this.context.globalAlpha = 0.05; this.context.fillStyle = 'rgb(0,0,255)'; this.context.fillRect(200, 200, 50, 50); }) diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineDashOffset.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineDashOffset.ets index 373e6a587cc0743e80e35b1c1bde299aef0a9da2..2ba278e25a27cb043fc8c67774770759563e214d 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineDashOffset.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineDashOffset.ets @@ -42,6 +42,10 @@ struct SetCircle { }) .onActionUpdate((event: GestureEvent) => { this.X = event.offsetX; + this.context.arc(180, 150, 50, 0, 6.28); + this.context.setLineDash([20,30]); + this.context.lineDashOffset = (this.X)*0.02; + this.context.stroke(); }) .onActionEnd(() => { console.info('Pan end'); @@ -49,7 +53,7 @@ struct SetCircle { ) }.width('70%').height('25%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('虚线偏移量: ' + (this.X)*0.1 ) + Text('虚线偏移量: ' + (this.X)*0.02 ) }.width('100%').height('20%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Canvas(this.context) @@ -59,7 +63,7 @@ struct SetCircle { .onReady(() =>{ this.context.arc(180, 150, 50, 0, 6.28); this.context.setLineDash([20,30]); - this.context.lineDashOffset = (this.X)*0.1; + this.context.lineDashOffset = 0.1; this.context.stroke(); }) }.width('100%').height('55%') diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineWidth.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineWidth.ets index 69c90de0d577e26bba68967eaf05e87d5c4a7ca2..329a76dab1cb99cc4769aa106540a959bc063a37 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineWidth.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasLineWidth.ets @@ -42,6 +42,8 @@ struct SetCircle { }) .onActionUpdate((event: GestureEvent) => { this.X = event.offsetX; + this.context.lineWidth = (this.X)*0.1; + this.context.strokeRect(120, 120, 120, 120); }) .onActionEnd(() => { console.info('Pan end'); @@ -50,7 +52,7 @@ struct SetCircle { }.width('70%').height('30%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('边框粗细: ' + (this.X)*0.05 ) + Text('边框粗细: ' + (this.X)*0.1 ) }.width('100%').height('20%') Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Canvas(this.context) @@ -58,7 +60,7 @@ struct SetCircle { .height('100%') .backgroundColor('#ffffffff') .onReady(() =>{ - this.context.lineWidth = (this.X)*0.05; + this.context.lineWidth = 1; this.context.strokeRect(120, 120, 120, 120); }) }.width('100%').height('50%') diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowBlur.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowBlur.ets index b5415836d7a6dc428ce66fab7d1de7fb8522ef39..1ebcb13c7bc8af8dd659dd400775e2b783f679fa 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowBlur.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowBlur.ets @@ -44,6 +44,10 @@ struct SetCircle { }) .onActionUpdate((event: GestureEvent) => { this.X = event.offsetX; + this.context.shadowBlur = this.X; + this.context.shadowColor = 'rgb(0,0,0)'; + this.context.fillStyle = 'rgb(255,0,0)'; + this.context.fillRect(150, 150, 100, 100); }) .onActionEnd(() => { console.info('Pan end'); @@ -59,7 +63,7 @@ struct SetCircle { .height('100%') .backgroundColor('#ffffffff') .onReady(() =>{ - this.context.shadowBlur = this.X; + this.context.shadowBlur = 0; this.context.shadowColor = 'rgb(0,0,0)'; this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillRect(150, 150, 100, 100); diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetX.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetX.ets index ec98ab485d5ea67ffec623a0f9ccf60eefa4c75a..20f22f866e927a87139f6969515b406117d6dd35 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetX.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetX.ets @@ -45,6 +45,11 @@ struct SetCircle { }) .onActionUpdate((event: GestureEvent) => { this.X = event.offsetX; + this.context.shadowBlur = 10; + this.context.shadowOffsetX = (this.X)*0.05; + this.context.shadowColor = 'rgb(0,0,0)'; + this.context.fillStyle = 'rgb(255,0,0)'; + this.context.fillRect(150, 150, 100, 100); }) .onActionEnd(() => { console.info('Pan end'); @@ -62,7 +67,7 @@ struct SetCircle { .backgroundColor('#ffffffff') .onReady(() =>{ this.context.shadowBlur = 10; - this.context.shadowOffsetX = (this.X)*0.05; + this.context.shadowOffsetX = 0; this.context.shadowColor = 'rgb(0,0,0)'; this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillRect(150, 150, 100, 100); diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetY.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetY.ets index 92674bd6c48d5a2c5c323005c5ccd7c19ba88863..0a2d6c9c56df72d9dca10dfbc4330bab0956ca1c 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetY.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/CanvasShadowOffsetY.ets @@ -45,6 +45,11 @@ struct SetCircle { }) .onActionUpdate((event: GestureEvent) => { this.X = event.offsetX; + this.context.shadowBlur = 10; + this.context.shadowOffsetY = (this.X)*0.05; + this.context.shadowColor = 'rgb(0,0,0)'; + this.context.fillStyle = 'rgb(255,0,0)'; + this.context.fillRect(150, 150, 100, 100); }) .onActionEnd(() => { console.info('Pan end'); @@ -61,7 +66,7 @@ struct SetCircle { .backgroundColor('#ffffffff') .onReady(() =>{ this.context.shadowBlur = 10; - this.context.shadowOffsetY = (this.X)*0.05; + this.context.shadowOffsetY = 0; this.context.shadowColor = 'rgb(0,0,0)'; this.context.fillStyle = 'rgb(255,0,0)'; this.context.fillRect(150, 150, 100, 100);