Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试实现一个类似 excel 的单击+拖动功能,用户单击一个单元格并拖动。当用户停止拖动时,我可以计算矩形的左上角和右下角。我也可以轻松计算矩形的长度、高度和面积,但是如何计算矩形内的坐标呢?
伪代码:
for i = left_edge to right_edge for j = top_edge to bottom_edge add [i, j] to list of points inside rectangle