From 54412927b2e1733b45d1eefd4f4d8e6d71cd187c Mon Sep 17 00:00:00 2001 From: Gabriel Wang Date: Fri, 27 Oct 2023 16:09:12 +0100 Subject: [PATCH] change rolling direction --- examples/common/controls/progress_wheel.c | 48 +++++++++++++---------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/examples/common/controls/progress_wheel.c b/examples/common/controls/progress_wheel.c index d1452c4f7..3985c0eda 100644 --- a/examples/common/controls/progress_wheel.c +++ b/examples/common/controls/progress_wheel.c @@ -155,62 +155,68 @@ void progress_wheel_show( progress_wheel_t *ptThis, tRotationRegion.tSize.iWidth = ((ptRegion->tSize.iWidth + 1) >> 1); tRotationRegion.tSize.iHeight = ((ptRegion->tSize.iHeight + 1) >> 1); - - if(this.fAngle < ARM_2D_ANGLE(90)){ + + if(this.fAngle > ARM_2D_ANGLE(90.0f)){ arm_2d_region_t tQuater = tRotationRegion; tQuater.tLocation.iX += ((ptRegion->tSize.iWidth + 1) >> 1); - tQuater.tLocation.iY += ((ptRegion->tSize.iWidth + 1) >> 1); arm_2dp_fill_colour_with_mask_opacity_and_transform( - &this.tOP[1], + &this.tOP[3], ptileArcMask, ptTarget, &tQuater, tCentre, - ARM_2D_ANGLE(180), + ARM_2D_ANGLE(90.0f), this.fScale, tWheelColour, chOpacity, &tTargetCentre); - - arm_2d_op_wait_async((arm_2d_op_core_t *)&this.tOP[1]); + + arm_2d_op_wait_async((arm_2d_op_core_t *)&this.tOP[3]); } - if(this.fAngle < ARM_2D_ANGLE(180)){ + if(this.fAngle > ARM_2D_ANGLE(180.0f)){ arm_2d_region_t tQuater = tRotationRegion; - tQuater.tLocation.iY += ((ptRegion->tSize.iWidth + 1) >> 1); + tQuater.tLocation.iX += ((ptRegion->tSize.iWidth + 1) >> 1); + tQuater.tLocation.iY += ((ptRegion->tSize.iHeight + 1) >> 1); + arm_2dp_fill_colour_with_mask_opacity_and_transform( - &this.tOP[2], + &this.tOP[1], ptileArcMask, ptTarget, &tQuater, tCentre, - ARM_2D_ANGLE(270), + ARM_2D_ANGLE(180.0f), this.fScale, tWheelColour, chOpacity, &tTargetCentre); - - arm_2d_op_wait_async((arm_2d_op_core_t *)&this.tOP[2]); - } + + arm_2d_op_wait_async((arm_2d_op_core_t *)&this.tOP[1]); - if(this.fAngle < ARM_2D_ANGLE(270)){ + } + + if(this.fAngle > ARM_2D_ANGLE(270.0)){ + arm_2d_region_t tQuater = tRotationRegion; + tQuater.tLocation.iY += ((ptRegion->tSize.iHeight + 1) >> 1); arm_2dp_fill_colour_with_mask_opacity_and_transform( - &this.tOP[3], + &this.tOP[2], ptileArcMask, ptTarget, - &tRotationRegion, + &tQuater, tCentre, - ARM_2D_ANGLE(0), + ARM_2D_ANGLE(270.0f), this.fScale, tWheelColour, chOpacity, &tTargetCentre); + + arm_2d_op_wait_async((arm_2d_op_core_t *)&this.tOP[2]); + } + - arm_2d_op_wait_async((arm_2d_op_core_t *)&this.tOP[3]); - } if (this.fAngle < ARM_2D_ANGLE(90)) { tRotationRegion.tLocation.iX += ((ptRegion->tSize.iWidth + 1) >> 1); @@ -227,7 +233,7 @@ void progress_wheel_show( progress_wheel_t *ptThis, ptTarget, &tRotationRegion, tCentre, - this.fAngle + ARM_2D_ANGLE(90), + this.fAngle, this.fScale, tWheelColour, chOpacity,