Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
25f19c11
Verified
Commit
25f19c11
authored
1 year ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Fix high CPU use caused by ItemParticle
parent
2a687a20
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
resources/qml/ui/TimelineEffects.qml
+35
-11
35 additions, 11 deletions
resources/qml/ui/TimelineEffects.qml
with
35 additions
and
11 deletions
resources/qml/ui/TimelineEffects.qml
+
35
−
11
View file @
25f19c11
...
@@ -9,6 +9,7 @@ Item {
...
@@ -9,6 +9,7 @@ Item {
id
:
effectRoot
id
:
effectRoot
readonly
property
int
maxLifespan
:
Math
.
max
(
confettiEmitter
.
lifeSpan
,
rainfallEmitter
.
lifeSpan
)
readonly
property
int
maxLifespan
:
Math
.
max
(
confettiEmitter
.
lifeSpan
,
rainfallEmitter
.
lifeSpan
)
required
property
bool
shouldEffectsRun
required
property
bool
shouldEffectsRun
visible
:
effectRoot
.
shouldEffectsRun
function
pulseConfetti
()
function
pulseConfetti
()
{
{
...
@@ -25,11 +26,13 @@ Item {
...
@@ -25,11 +26,13 @@ Item {
Component.onCompleted
:
pause
();
Component.onCompleted
:
pause
();
paused
:
!
effectRoot
.
shouldEffectsRun
paused
:
!
effectRoot
.
shouldEffectsRun
running
:
effectRoot
.
shouldEffectsRun
}
}
Emitter
{
Emitter
{
id
:
confettiEmitter
id
:
confettiEmitter
Component.onCompleted
:
stop
();
group
:
"
confetti
"
group
:
"
confetti
"
width
:
effectRoot
.
width
*
3
/
4
width
:
effectRoot
.
width
*
3
/
4
enabled
:
false
enabled
:
false
...
@@ -89,26 +92,47 @@ Item {
...
@@ -89,26 +92,47 @@ Item {
enabled
:
false
enabled
:
false
anchors.horizontalCenter
:
effectRoot
.
horizontalCenter
anchors.horizontalCenter
:
effectRoot
.
horizontalCenter
y
:
-
60
y
:
-
60
emitRate
:
effectRoot
.
width
/
5
0
emitRate
:
effectRoot
.
width
/
3
0
lifeSpan
:
10000
lifeSpan
:
10000
system
:
particleSystem
system
:
particleSystem
velocity
:
PointDirection
{
velocity
:
PointDirection
{
x
:
0
x
:
0
y
:
3
00
y
:
4
00
xVariation
:
0
xVariation
:
0
yVariation
:
75
yVariation
:
75
}
}
ItemParticle
{
// causes high CPU load, see: https://bugreports.qt.io/browse/QTBUG-117923
system
:
particleSystem
//ItemParticle {
groups
:
[
"
rain
"
]
// system: particleSystem
fade
:
false
// groups: ["rain"]
delegate
:
Rectangle
{
// fade: false
width
:
2
// visible: effectRoot.shouldEffectsRun
height
:
30
+
30
*
Math
.
random
()
// delegate: Rectangle {
radius
:
2
// width: 2
// height: 30 + 30 * Math.random()
// radius: 2
// color: "#0099ff"
// }
//}
ImageParticle
{
system
:
particleSystem
groups
:
[
"
rain
"
]
source
:
"
qrc:/confettiparticle.svg
"
rotationVelocity
:
0
rotationVelocityVariation
:
0
colorVariation
:
0
color
:
"
#0099ff
"
color
:
"
#0099ff
"
entryEffect
:
ImageParticle
.
None
xVector
:
PointDirection
{
x
:
0.01
y
:
0
}
yVector
:
PointDirection
{
x
:
0
y
:
5
}
}
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment