diff --git a/touchview/src/main/java/com/ortiz/touchview/TouchImageView.java b/touchview/src/main/java/com/ortiz/touchview/TouchImageView.java index 99bf7352..6ca9f0e3 100644 --- a/touchview/src/main/java/com/ortiz/touchview/TouchImageView.java +++ b/touchview/src/main/java/com/ortiz/touchview/TouchImageView.java @@ -674,8 +674,8 @@ protected void onSizeChanged(int w, int h, int oldw, int oldh) { // big or too small, thus making the current zoom fall outside of an automatically-changing // minZoom and maxZoom). // - viewWidth = w; - viewHeight = h; + viewWidth = w - getPaddingLeft() - getPaddingRight(); + viewHeight = h - getPaddingTop() - getPaddingBottom(); fitImageToView(); }