Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: components/test_runner/mock_web_theme_engine.cc

Issue 2340633002: Modifies logic for computing drop down menu arrow's dimensions and how it is drawn. (Closed)
Patch Set: Modifies logic for computing drop down menu arrow's dimensions and how it is drawn. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/test_runner/mock_web_theme_engine.cc
diff --git a/components/test_runner/mock_web_theme_engine.cc b/components/test_runner/mock_web_theme_engine.cc
index fed1934d510633f1974f475aa4f40417178e7ae9..031e171d4831c059792c2f57fa2719a10788eda6 100644
--- a/components/test_runner/mock_web_theme_engine.cc
+++ b/components/test_runner/mock_web_theme_engine.cc
@@ -482,24 +482,27 @@ void MockWebThemeEngine::paint(blink::WebCanvas* canvas,
}
// clip the drop-down arrow to be inside the select box
- if (extraParams->menuList.arrowX - 4 > irect.fLeft)
- irect.fLeft = extraParams->menuList.arrowX - 4;
- if (extraParams->menuList.arrowX + 12 < irect.fRight)
- irect.fRight = extraParams->menuList.arrowX + 12;
+ if(irect.fLeft < extraParams->menuList.arrowX -
+ (extraParams->menuList.arrowSize + 1) / 2)
oshima 2016/09/17 01:31:21 can you use std::max ?
malaykeshav 2016/09/19 18:09:27 Done
+ irect.fLeft = extraParams->menuList.arrowX -
+ (extraParams->menuList.arrowSize + 1) / 2;
+ if(irect.fLeft + extraParams->menuList.arrowSize < irect.fRight)
+ irect.fRight = irect.fLeft + extraParams->menuList.arrowSize;
oshima 2016/09/17 01:31:21 ditto
malaykeshav 2016/09/19 18:09:27 Done
irect.fTop = extraParams->menuList.arrowY -
(extraParams->menuList.arrowSize) / 2;
- irect.fBottom = extraParams->menuList.arrowY +
- (extraParams->menuList.arrowSize - 1) / 2;
+ irect.fBottom = irect.fTop + (extraParams->menuList.arrowSize);
+
halfWidth = irect.width() / 2;
quarterWidth = irect.width() / 4;
if (state == WebThemeEngine::StateFocused) // FIXME: draw differenty?
state = WebThemeEngine::StateNormal;
box(canvas, irect, bgColors(state));
- triangle(canvas, irect.fLeft + quarterWidth, irect.fTop,
- irect.fRight - quarterWidth, irect.fTop, irect.fLeft + halfWidth,
- irect.fBottom, edgeColor);
+ triangle(canvas, irect.fLeft + quarterWidth, irect.fTop + quarterWidth,
+ irect.fRight - quarterWidth, irect.fTop + quarterWidth,
+ irect.fLeft + halfWidth,
+ irect.fBottom - quarterWidth, edgeColor);
break;

Powered by Google App Engine
This is Rietveld 408576698