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); |