For example, the code in Listing 1 draws a square using the rect function, then specifies a change to the coordinate system using translate.
例如,清单1所示代码使用rect函数绘制了一个正方形,然后使用translate修改坐标系统。
The rect function draws a rectangle, with the first two points defining the location and the next two defining width and height, respectively.
rect函数可绘制一个矩形,并且前两个点定义位置,而后面两个点则分别定义宽度和高度。
Any new shapes drawn after the translate function appears using the offset; so in this case, the rect function actually creates a square at 100, 100, 150, 150, as shown in Figure 1, cell a.
translate函数之后绘制的任何形状都会加上这个偏移量;所以在这里,rect函数实际上在坐标100,100,150,150上创建一个正方形,如图1的单元格a所示。
Any new shapes drawn after the translate function appears using the offset; so in this case, the rect function actually creates a square at 100, 100, 150, 150, as shown in Figure 1, cell a.
translate函数之后绘制的任何形状都会加上这个偏移量;所以在这里,rect函数实际上在坐标100,100,150,150上创建一个正方形,如图1的单元格a所示。
应用推荐