Lines Matching refs:rect
24 void DrawRect::Draw(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
27 if ((rect.GetWidth() <= 0) || (rect.GetHeight() <= 0)) {
36 * rect width > rect height
37 * radius >= rect height / 2
38 * radius < rect height / 2
39 * rect width <= rect height
40 * radius >= rect width / 2
41 * radius < rect width / 2
48 * rect width <= rect height
49 * radius >= border width + rect height / 2
50 * radius < border width + rect height / 2
51 * rect width > rect height
52 * radius >= border width + rect height / 2
53 * radius < border width + rect height / 2
59 DrawUtils::GetInstance()->DrawColorArea(gfxDstBuffer, rect, dirtyRect, style.bgColor_, opa);
63 DrawRectRadiusWithoutBorder(gfxDstBuffer, rect, dirtyRect, style, opaScale);
68 DrawRectBorderWithoutRadius(gfxDstBuffer, rect, dirtyRect, style, opaScale);
71 DrawRectRadiusSmallThanBorder(gfxDstBuffer, rect, dirtyRect, style, opaScale);
74 DrawRectRadiusEqualBorder(gfxDstBuffer, rect, dirtyRect, style, opaScale);
76 /* [4.3/4] radius >= border width + rect height_or_width / 2 */
77 DrawRectRadiusBiggerThanBorder(gfxDstBuffer, rect, dirtyRect, style, opaScale);
82 void DrawRect::DrawRectRadiusWithoutBorder(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
86 if ((rect.GetWidth() > rect.GetHeight()) && (style.borderRadius_ >= rect.GetHeight() / 2)) {
87 DrawRectRadiusWithoutBorderCon1(gfxDstBuffer, rect, dirtyRect, style, opaScale);
88 } else if ((rect.GetWidth() < rect.GetHeight()) && (style.borderRadius_ >= rect.GetWidth() / 2)) {
89 DrawRectRadiusWithoutBorderCon2(gfxDstBuffer, rect, dirtyRect, style, opaScale);
90 } else if ((rect.GetWidth() == rect.GetHeight()) && (style.borderRadius_ >= rect.GetWidth() / 2)) {
91 DrawRectRadiusWithoutBorderCon3(gfxDstBuffer, rect, dirtyRect, style, opaScale);
93 DrawRectRadiusWithoutBorderCon4(gfxDstBuffer, rect, dirtyRect, style, opaScale);
97 void DrawRect::DrawRectRadiusWithoutBorderCon1(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
100 int16_t radius = rect.GetHeight() / 2;
101 int16_t col2X = rect.GetLeft() + radius - 1;
102 int16_t col3X = rect.GetRight() - radius + 1;
104 int16_t row1Y = rect.GetTop();
105 int16_t row2Y = rect.GetTop() + radius - 1;
106 int16_t row3Y = rect.GetBottom();
140 void DrawRect::DrawRectRadiusWithoutBorderCon2(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
143 int16_t radius = rect.GetWidth() / 2;
144 int16_t col1X = rect.GetLeft();
145 int16_t col2X = rect.GetLeft() + radius - 1;
146 int16_t col3X = rect.GetRight();
148 int16_t row2Y = rect.GetTop() + radius - 1;
149 int16_t row3Y = rect.GetBottom() - radius + 1;
178 void DrawRect::DrawRectRadiusWithoutBorderCon3(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
181 int16_t radius = rect.GetWidth() / 2;
182 int16_t col1X = rect.GetLeft() + radius - 1;
183 int16_t row1Y = rect.GetTop() + radius - 1;
200 void DrawRect::DrawRectRadiusWithoutBorderCon4(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
204 int16_t col1X = rect.GetLeft();
205 int16_t col2X = rect.GetLeft() + radius - 1;
206 int16_t col3X = rect.GetRight() - radius + 1;
207 int16_t col4X = rect.GetRight();
209 int16_t row1Y = rect.GetTop();
210 int16_t row2Y = rect.GetTop() + radius - 1;
211 int16_t row3Y = rect.GetBottom() - radius + 1;
212 int16_t row4Y = rect.GetBottom();
262 void DrawRect::DrawRectBorderWithoutRadius(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
265 int16_t col1X = rect.GetLeft();
266 int16_t col2X = rect.GetLeft() + style.borderWidth_ - 1;
267 int16_t col3X = rect.GetRight() - style.borderWidth_ + 1;
268 int16_t col4X = rect.GetRight();
270 int16_t row1Y = rect.GetTop();
271 int16_t row2Y = rect.GetTop() + style.borderWidth_ - 1;
272 int16_t row3Y = rect.GetBottom() - style.borderWidth_ + 1;
273 int16_t row4Y = rect.GetBottom();
299 void DrawRect::DrawRectRadiusEqualBorder(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
302 int16_t col1X = rect.GetLeft();
303 int16_t col2X = rect.GetLeft() + style.borderRadius_ - 1;
304 int16_t col3X = rect.GetRight() - style.borderRadius_ + 1;
305 int16_t col4X = rect.GetRight();
307 int16_t row1Y = rect.GetTop();
308 int16_t row2Y = rect.GetTop() + style.borderRadius_ - 1;
309 int16_t row3Y = rect.GetBottom() - style.borderRadius_ + 1;
310 int16_t row4Y = rect.GetBottom();
369 void DrawRect::DrawRectRadiusSmallThanBorder(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
372 int16_t radiusCol1X = rect.GetLeft();
373 int16_t radiusCol2X = rect.GetLeft() + style.borderRadius_ - 1;
374 int16_t radiusCol3X = rect.GetRight() - style.borderRadius_ + 1;
375 int16_t radiusCol4X = rect.GetRight();
377 int16_t radiusRow1Y = rect.GetTop();
378 int16_t radiusRow2Y = rect.GetTop() + style.borderRadius_ - 1;
379 int16_t radiusRow3Y = rect.GetBottom() - style.borderRadius_ + 1;
380 int16_t radiusRow4Y = rect.GetBottom();
383 int16_t rectCol2X = rect.GetLeft() + style.borderWidth_ - 1;
384 int16_t rectCol3X = rect.GetRight() - style.borderWidth_ + 1;
388 int16_t rectRow2Y = rect.GetTop() + style.borderWidth_ - 1;
389 int16_t rectRow3Y = rect.GetBottom() - style.borderWidth_ + 1;
452 void DrawRect::DrawRectRadiusBiggerThanBorder(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
456 if ((rect.GetWidth() > rect.GetHeight()) && (style.borderRadius_ >= rect.GetHeight() / 2)) {
457 DrawRectRadiusBiggerThanBorderCon1(gfxDstBuffer, rect, dirtyRect, style, opaScale);
458 } else if ((rect.GetWidth() < rect.GetHeight()) && (style.borderRadius_ >= rect.GetWidth() / 2)) {
459 DrawRectRadiusBiggerThanBorderCon2(gfxDstBuffer, rect, dirtyRect, style, opaScale);
460 } else if ((rect.GetWidth() == rect.GetHeight()) && (style.borderRadius_ >= rect.GetWidth() / 2)) {
461 DrawRectRadiusBiggerThanBorderCon3(gfxDstBuffer, rect, dirtyRect, style, opaScale);
463 DrawRectRadiusBiggerThanBorderCon4(gfxDstBuffer, rect, dirtyRect, style, opaScale);
467 void DrawRect::DrawRectRadiusBiggerThanBorderCon1(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
470 int16_t radius = rect.GetHeight() / 2;
472 int16_t col2X = rect.GetLeft() + radius - 1;
473 int16_t col3X = rect.GetRight() - radius + 1;
475 int16_t row1Y = rect.GetTop();
476 int16_t row2Y = rect.GetTop() + borderWidth - 1;
477 int16_t row3Y = rect.GetTop() + radius - 1;
478 int16_t row4Y = rect.GetBottom() - borderWidth + 1;
479 int16_t row5Y = rect.GetBottom();
536 void DrawRect::DrawRectRadiusBiggerThanBorderCon2(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
539 int16_t radius = rect.GetWidth() / 2;
541 int16_t col1X = rect.GetLeft();
542 int16_t col2X = rect.GetLeft() + borderWidth - 1;
543 int16_t col3X = rect.GetLeft() + radius - 1;
544 int16_t col4X = rect.GetRight() - borderWidth + 1;
545 int16_t col5X = rect.GetRight();
547 int16_t row2Y = rect.GetTop() + radius - 1;
548 int16_t row3Y = rect.GetBottom() - radius + 1;
603 void DrawRect::DrawRectRadiusBiggerThanBorderCon3(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
606 int16_t radius = rect.GetWidth() / 2;
608 int16_t col2X = rect.GetLeft() + radius - 1;
609 int16_t row2Y = rect.GetTop() + radius - 1;
639 void DrawRect::DrawRectRadiusBiggerThanBorderCon4(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
644 int16_t col1X = rect.GetLeft();
645 int16_t col2X = rect.GetLeft() + borderWidth - 1;
646 int16_t col3X = rect.GetLeft() + radius - 1;
647 int16_t col4X = rect.GetRight() - radius + 1;
648 int16_t col5X = rect.GetRight() - borderWidth + 1;
649 int16_t col6X = rect.GetRight();
651 int16_t row1Y = rect.GetTop();
652 int16_t row2Y = rect.GetTop() + borderWidth - 1;
653 int16_t row3Y = rect.GetTop() + radius - 1;
654 int16_t row4Y = rect.GetBottom() - radius + 1;
655 int16_t row5Y = rect.GetBottom() - borderWidth + 1;
656 int16_t row6Y = rect.GetBottom();