Tweak rendering performance for power balance animation
This commit is contained in:
parent
991aa8238e
commit
71533ee176
@ -99,6 +99,8 @@ MainViewBase {
|
|||||||
topMargin: root.topMargin
|
topMargin: root.topMargin
|
||||||
bottomMargin: root.bottomMargin
|
bottomMargin: root.bottomMargin
|
||||||
|
|
||||||
|
// onContentYChanged: print("contentY", contentY)
|
||||||
|
|
||||||
// GridLayout directly in a flickable causes problems at initialisation
|
// GridLayout directly in a flickable causes problems at initialisation
|
||||||
Item {
|
Item {
|
||||||
width: flickable.width
|
width: flickable.width
|
||||||
@ -132,7 +134,8 @@ MainViewBase {
|
|||||||
Layout.preferredHeight: width
|
Layout.preferredHeight: width
|
||||||
energyManager: energyManager
|
energyManager: energyManager
|
||||||
visible: rootMeter != null || producers.count > 0
|
visible: rootMeter != null || producers.count > 0
|
||||||
animationsEnabled: Qt.application.active && root.isCurrentItem
|
animationsEnabled: Qt.application.active && root.isCurrentItem && flickable.contentY < height
|
||||||
|
onAnimationsEnabledChanged: print("animations for power balance chart", animationsEnabled ? "enabled" : "disabled")
|
||||||
}
|
}
|
||||||
|
|
||||||
PowerBalanceHistory {
|
PowerBalanceHistory {
|
||||||
@ -168,7 +171,9 @@ MainViewBase {
|
|||||||
visible: consumers.count > 0
|
visible: consumers.count > 0
|
||||||
colors: root.thingColors
|
colors: root.thingColors
|
||||||
consumers: consumers
|
consumers: consumers
|
||||||
animationsEnabled: Qt.application.active && root.isCurrentItem
|
animationsEnabled: Qt.application.active && root.isCurrentItem && flickable.contentY < y + height && flickable.contentY + flickable.height > y
|
||||||
|
onAnimationsEnabledChanged: print("animations for consumer balance chart", animationsEnabled ? "enabled" : "disabled")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ConsumersHistory {
|
ConsumersHistory {
|
||||||
|
|||||||
@ -70,6 +70,9 @@ Item {
|
|||||||
id: canvas
|
id: canvas
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
renderTarget: Canvas.FramebufferObject
|
||||||
|
renderStrategy: Canvas.Cooperative
|
||||||
|
|
||||||
onPaint: {
|
onPaint: {
|
||||||
var ctx = getContext("2d");
|
var ctx = getContext("2d");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user