Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(742)

Unified Diff: samplecode/SampleHT.cpp

Issue 2142033002: Factor code to rotate a canvas about a point. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move to canvas. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: samplecode/SampleHT.cpp
diff --git a/samplecode/SampleHT.cpp b/samplecode/SampleHT.cpp
index d0cd3a54996dce2211c17b9a4637b75f29a5ff92..50ea2875ec2f02fa5bff0ea2480853973ef830c4 100644
--- a/samplecode/SampleHT.cpp
+++ b/samplecode/SampleHT.cpp
@@ -95,9 +95,7 @@ public:
fColor = floats_to_color(values);
canvas->save();
- canvas->translate(fR.centerX(), fR.centerY());
- canvas->rotate(values[4]);
- canvas->translate(-fR.centerX(), -fR.centerY());
+ canvas->rotate(values[4], fR.centerX(), fR.centerY());
switch (res) {
case SkInterpolator::kFreezeEnd_Result:

Powered by Google App Engine
This is Rietveld 408576698