Bug Fix: Resets the users zoom and translation every picture load. Was acting inconsistently between different viewing widgets, now forces a redraw every new picture.
Review URL: https://codereview.appspot.com/6450130
git-svn-id: http://skia.googlecode.com/svn/trunk@5083 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/debugger/QT/SkCanvasWidget.h b/debugger/QT/SkCanvasWidget.h
index ff72c60..ab634f8 100644
--- a/debugger/QT/SkCanvasWidget.h
+++ b/debugger/QT/SkCanvasWidget.h
@@ -36,6 +36,8 @@
void zoom(float zoomIncrement);
+ void resetWidgetTransform();
+
signals:
void scaleFactorChanged(float newScaleFactor);
void commandChanged(int newCommand);
@@ -55,8 +57,6 @@
SkIPoint fUserOffset;
float fUserScaleFactor;
- void resetWidgetTransform();
-
void mouseMoveEvent(QMouseEvent* event);
void mousePressEvent(QMouseEvent* event);
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp
index a311916..6075df0 100644
--- a/debugger/QT/SkDebuggerGUI.cpp
+++ b/debugger/QT/SkDebuggerGUI.cpp
@@ -575,7 +575,9 @@
fLoading = true;
SkStream* stream = new SkFILEStream(fileName.toAscii());
SkPicture* picture = new SkPicture(stream);
+ fCanvasWidget.resetWidgetTransform();
fDebugger.loadPicture(picture);
+ fCanvasWidget.drawTo(fDebugger.index());
SkSafeUnref(stream);
SkSafeUnref(picture);