aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleLua.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'samplecode/SampleLua.cpp')
-rw-r--r--samplecode/SampleLua.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/samplecode/SampleLua.cpp b/samplecode/SampleLua.cpp
index e7af727ab5..1536ed4fb8 100644
--- a/samplecode/SampleLua.cpp
+++ b/samplecode/SampleLua.cpp
@@ -100,6 +100,12 @@ protected:
}
virtual void onDrawContent(SkCanvas* canvas) SK_OVERRIDE {
+ SkMatrix matrix;
+ matrix.setRectToRect(SkRect::MakeWH(640, 480),
+ SkRect::MakeWH(this->width(), this->height()),
+ SkMatrix::kCenter_ScaleToFit);
+ canvas->concat(matrix);
+
lua_State* L = this->ensureLua();
lua_getglobal(L, gDrawName);