本文介绍了帆布剪裁RECT - 右/底部边缘包容性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android上,有一个Canvas类,再presents的绘图面。它有一个剪辑正确。的问题 - 是矩形的右侧和底部边框包括或不?换句话说 - 如果矩形是(0,0) - (10,10),将所述画布允许以像素为单位在绘图座标10

on Android, there's a Canvas class that represents a drawing surface. It has a clipping rect. Question - are the rect's right and bottom borders inclusive or exclusive? In other words - if the rect is (0, 0)-(10, 10), will the Canvas allow drawing in pixels at coordinates 10?

推荐答案

另据StackOverflow的问题,右键是互斥的。正如我在我的回答有(我想确实是一个注释),这是与其他Java API一致,还有其他好处。

According to another StackOverflow question, right and bottom are exclusive. As I say in my answer there (which I suppose is really a comment), this is consistent with other Java API, and has other benefits.

所以,不,你将无法在纵坐标10绘制但它确实意味着你的矩形是一个10×10像素的正方形。

So, no, you won't be able to draw at ordinate 10. But it does mean that your Rect is a 10×10 pixel square.

这篇关于帆布剪裁RECT - 右/底部边缘包容性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 17:42