From 32ae474803883f4ad05d6d2e5eea1f4532f5bf07 Mon Sep 17 00:00:00 2001 From: sloop Date: Fri, 12 Aug 2016 19:24:01 +0800 Subject: [PATCH] Update value compute --- CustomView/Advance/[10]Matrix_Method.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CustomView/Advance/[10]Matrix_Method.md b/CustomView/Advance/[10]Matrix_Method.md index eb819b2..727ebaa 100644 --- a/CustomView/Advance/[10]Matrix_Method.md +++ b/CustomView/Advance/[10]Matrix_Method.md @@ -289,6 +289,17 @@ mapRadius: 70.71068 **3.mapRect** ``` java + RectF rect = new RectF(400, 400, 1000, 800); + + // 构造一个matrix,x坐标缩放0.5 + Matrix matrix = new Matrix(); + matrix.setScale(0.5f, 1f); + + Log.i(TAG, "mapRadius: "+rect.toString()); + + matrix.mapRect(rect); + + Log.i(TAG, "mapRadius: "+rect.toString()); ``` 测量矩形变换后位置。