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

Unified Diff: include/views/SkTouchGesture.h

Issue 1996613002: Correct gesture scale and translation (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nits Created 4 years, 7 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
« no previous file with comments | « no previous file | src/views/SkTouchGesture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/views/SkTouchGesture.h
diff --git a/include/views/SkTouchGesture.h b/include/views/SkTouchGesture.h
index 60487c7a2f285f0d62c820431c016363880bda69..4d4c0312d3304ef3391e48256aba36257c9d0316 100644
--- a/include/views/SkTouchGesture.h
+++ b/include/views/SkTouchGesture.h
@@ -43,6 +43,8 @@ public:
const SkMatrix& localM();
const SkMatrix& globalM() const { return fGlobalM; }
+ void setTransLimit(const SkRect& contentRect, const SkRect& windowRect);
+
private:
enum State {
kEmpty_State,
@@ -65,7 +67,11 @@ private:
double fLastUpMillis;
SkPoint fLastUpP;
+ // The following rects are used to limit the translation so the content never leaves the window
+ SkRect fContentRect, fWindowRect;
+ bool fIsTransLimited = false;
+ void limitTrans(); // here we only limit the translation with respect to globalM
void flushLocalM();
int findRec(void* owner) const;
void appendNewRec(void* owner, float x, float y);
« no previous file with comments | « no previous file | src/views/SkTouchGesture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698