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

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..fb0813b14d32812e8a50cdc2f1b680a89d1ded91 100644
--- a/components/test_runner/mock_web_theme_engine.cc
+++ b/components/test_runner/mock_web_theme_engine.cc
@@ -482,24 +482,26 @@ 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;
+ irect.fLeft =
+ std::max(irect.fLeft, extraParams->menuList.arrowX -
+ (extraParams->menuList.arrowSize + 1) / 2);
+ irect.fRight =
+ std::min(irect.fLeft + extraParams->menuList.arrowSize, irect.fRight);
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;
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/TestExpectations » ('j') | third_party/WebKit/LayoutTests/TestExpectations » ('J')

Powered by Google App Engine
This is Rietveld 408576698