public void SetArea(Rect r0, Rect r1) { r1.yMin = r0.yMax; Rect unionRect = ToolSet.Union(ref r0, ref r1); r0.position -= unionRect.position; r1.position -= unionRect.position; shape.SetXY(unionRect.x, unionRect.y); shape.SetSize(unionRect.width, unionRect.height); if (_points8 == null) { _points8 = new Vector2[8]; } _points8[0] = new Vector2(r0.xMin, r0.yMax); _points8[1] = new Vector2(r0.xMin, r0.yMin); _points8[2] = new Vector2(r0.xMax, r0.yMin); _points8[3] = new Vector2(r0.xMax, r0.yMax); _points8[4] = new Vector2(r1.xMax, r1.yMin); _points8[5] = new Vector2(r1.xMax, r1.yMax); _points8[6] = new Vector2(r1.xMin, r1.yMax); _points8[7] = new Vector2(r1.xMin, r1.yMin); shape.DrawPolygon(_owner.htmlParseOptions.linkBgColor, _points8); }
public void SetArea(Rect r0, Rect r1, Rect r2) { Rect unionRect = ToolSet.Union(ref r0, ref r1); unionRect = ToolSet.Union(ref unionRect, ref r2); r0.position -= unionRect.position; r1.position -= unionRect.position; r2.position -= unionRect.position; shape.SetXY(unionRect.x, unionRect.y); shape.SetSize(unionRect.width, unionRect.height); if (_points12 == null) { _points12 = new Vector2[12]; } _points12[0] = new Vector2(r0.xMin, r0.yMax); _points12[1] = new Vector2(r0.xMin, r0.yMin); _points12[2] = new Vector2(r0.xMax, r0.yMin); _points12[3] = new Vector2(r0.xMax, r0.yMax); _points12[4] = new Vector2(r1.xMax, r1.yMin); _points12[5] = new Vector2(r1.xMax, r1.yMax); _points12[6] = new Vector2(r2.xMax, r2.yMin); _points12[7] = new Vector2(r2.xMax, r2.yMax); _points12[8] = new Vector2(r2.xMin, r2.yMax); _points12[9] = new Vector2(r2.xMin, r2.yMin); _points12[10] = new Vector2(r1.xMin, r1.yMax); _points12[11] = new Vector2(r1.xMin, r1.yMin); shape.DrawPolygon(_owner.htmlParseOptions.linkBgColor, _points12); }