Merge "HWC: Use proper typecast to avoid scaling issues"
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index 85a9a43..5c36304 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -1048,10 +1048,10 @@
}
calc_cut(leftCutRatio, topCutRatio, rightCutRatio, bottomCutRatio, orient);
- crop_l += crop_w * leftCutRatio;
- crop_t += crop_h * topCutRatio;
- crop_r -= crop_w * rightCutRatio;
- crop_b -= crop_h * bottomCutRatio;
+ crop_l += (int)round((double)crop_w * leftCutRatio);
+ crop_t += (int)round((double)crop_h * topCutRatio);
+ crop_r -= (int)round((double)crop_w * rightCutRatio);
+ crop_b -= (int)round((double)crop_h * bottomCutRatio);
}
bool areLayersIntersecting(const hwc_layer_1_t* layer1,