public void SetArea(Rect rect) { Rect contentRect = _owner.contentRect; rect = ToolSet.Intersection(ref contentRect, ref rect); if (rect.width == 0 || rect.height == 0) { shape.Clear(); } else { shape.SetXY(rect.x, rect.y); shape.SetSize(rect.width, rect.height); shape.DrawRect(0, Color.clear, _owner.htmlParseOptions.linkBgColor); } }
public void SetArea(Rect r0, Rect r1, Rect r2) { Rect contentRect = _owner.contentRect; r0 = ToolSet.Intersection(ref contentRect, ref r0); r1 = ToolSet.Intersection(ref contentRect, ref r1); r2 = ToolSet.Intersection(ref contentRect, ref r2); Rect unionRect = ToolSet.Union(ref r0, ref r1); unionRect = ToolSet.Union(ref unionRect, ref r2); if (unionRect.width == 0 || unionRect.height == 0) { shape.Clear(); } else { 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); } }