diff options
author | liyuqian <liyuqian@google.com> | 2016-05-20 07:32:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-20 07:32:19 -0700 |
commit | e46e4f075bfa8acf038aa68a8e7da282d4c1015b (patch) | |
tree | a599a8727b8903da82c1c192323b93def50943f4 /include/views | |
parent | 87751127172bd49c632c9290ffde43385d38ce61 (diff) |
Correct gesture scale and translation
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1996613002
Review-Url: https://codereview.chromium.org/1996613002
Diffstat (limited to 'include/views')
-rw-r--r-- | include/views/SkTouchGesture.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/views/SkTouchGesture.h b/include/views/SkTouchGesture.h index 60487c7a2f..4d4c0312d3 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); |