forked from qt-creator/qt-creator
QmlProfiler: Try harder to obtain a canvas context
The QML canvas is notoriously bad at keeping its context around. This workaround gives us a valid context in many of these cases. Change-Id: I6c23aa2b44c10a48cdb89c66a2861ab8d31bcfc8 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -48,8 +48,7 @@ Canvas {
|
||||
}
|
||||
|
||||
onPaint: {
|
||||
if (context === null)
|
||||
return; // canvas isn't ready
|
||||
var context = (timeDisplay.context === null) ? getContext("2d") : timeDisplay.context;
|
||||
|
||||
context.reset();
|
||||
context.fillStyle = "white";
|
||||
|
||||
Reference in New Issue
Block a user