From ad4d0774808f253baa3b3fc64a6ce11e51f9e439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Wed, 5 Jul 2023 21:34:08 +0800 Subject: [PATCH] update --- example/qml/window/MainWindow.qml | 6 ------ example/src/component/CircularReveal.cpp | 2 ++ src/imports/FluentUI/Controls/FluItem.qml | 1 - src/imports/FluentUI/Controls/FluProgressRing.qml | 1 - src/imports/FluentUI/Controls/FluRectangle.qml | 10 +++++++++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/example/qml/window/MainWindow.qml b/example/qml/window/MainWindow.qml index 2a6b8702..1da8c5d1 100644 --- a/example/qml/window/MainWindow.qml +++ b/example/qml/window/MainWindow.qml @@ -175,12 +175,6 @@ CustomWindow { displayMode:MainEvent.displayMode logo: "qrc:/example/res/image/favicon.ico" title:"FluentUI" - Behavior on rotation { - NumberAnimation{ - duration: 167 - } - } - transformOrigin: Item.Center onLogoClicked:{ clickCount += 1 if(clickCount === 1){ diff --git a/example/src/component/CircularReveal.cpp b/example/src/component/CircularReveal.cpp index 2dfe9098..29464197 100644 --- a/example/src/component/CircularReveal.cpp +++ b/example/src/component/CircularReveal.cpp @@ -5,6 +5,7 @@ CircularReveal::CircularReveal(QQuickItem* parent) : QQuickPaintedItem(parent) { + setVisible(false); _anim = new QPropertyAnimation(this, "radius", this); _anim->setDuration(333); _anim->setEasingCurve(QEasingCurve::OutCubic); @@ -19,6 +20,7 @@ CircularReveal::CircularReveal(QQuickItem* parent) : QQuickPaintedItem(parent) void CircularReveal::paint(QPainter* painter) { painter->save(); + painter->eraseRect(boundingRect()); painter->drawImage(QRect(0, 0, static_cast(width()), static_cast(height())), _source); QPainterPath path; path.moveTo(_center.x(),_center.y()); diff --git a/src/imports/FluentUI/Controls/FluItem.qml b/src/imports/FluentUI/Controls/FluItem.qml index a3a15afe..7fc12d8b 100644 --- a/src/imports/FluentUI/Controls/FluItem.qml +++ b/src/imports/FluentUI/Controls/FluItem.qml @@ -31,7 +31,6 @@ Item{ var y = 0; var w = control.width; var h = control.height; - ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.save(); ctx.beginPath(); diff --git a/src/imports/FluentUI/Controls/FluProgressRing.qml b/src/imports/FluentUI/Controls/FluProgressRing.qml index 07ecacaf..5eec679c 100644 --- a/src/imports/FluentUI/Controls/FluProgressRing.qml +++ b/src/imports/FluentUI/Controls/FluProgressRing.qml @@ -56,7 +56,6 @@ Rectangle { renderTarget: Canvas.Image onPaint: { var ctx = canvas.getContext("2d") - ctx.setTransform(1, 0, 0, 1, 0, 0) ctx.clearRect(0, 0, canvas.width, canvas.height) ctx.save() ctx.lineWidth = linWidth diff --git a/src/imports/FluentUI/Controls/FluRectangle.qml b/src/imports/FluentUI/Controls/FluRectangle.qml index 6493cec5..e0450778 100644 --- a/src/imports/FluentUI/Controls/FluRectangle.qml +++ b/src/imports/FluentUI/Controls/FluRectangle.qml @@ -9,6 +9,15 @@ Item{ property bool shadow: true default property alias contentItem: container.data id:control + onWidthChanged: { + canvas.requestPaint() + } + onHeightChanged: { + canvas.requestPaint() + } + onRadiusChanged: { + canvas.requestPaint() + } FluShadow{ anchors.fill: container radius: control.radius[0] @@ -36,7 +45,6 @@ Item{ var y = 0; var w = control.width; var h = control.height; - ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.save(); ctx.beginPath();