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

Unified Diff: ui/views/bubble/bubble_border.cc

Issue 10689145: Fix BubbleBorder wrong arrow for BOTTOM_LEFT and RIGHT_TOP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_border.cc
diff --git a/ui/views/bubble/bubble_border.cc b/ui/views/bubble/bubble_border.cc
index be2e8365c26b536698cf4149af80cef4315b8ea2..656e296569e7a6f9825a98fb0440f5bc06c6418b 100644
--- a/ui/views/bubble/bubble_border.cc
+++ b/ui/views/bubble/bubble_border.cc
@@ -455,8 +455,10 @@ void BubbleBorder::DrawEdgeWithArrow(gfx::Canvas* canvas,
void BubbleBorder::DrawArrowInterior(gfx::Canvas* canvas,
float tip_x,
float tip_y) const {
+ const bool is_horizontal = is_arrow_on_horizontal(arrow_location_);
const int offset_to_next_vertex =
Peter Kasting 2012/07/10 22:45:27 Nit: Slightly simpler: const bool positive_offs
xiyuan 2012/07/11 00:53:55 Changed. I like yours better.
- (is_arrow_on_left(arrow_location_) || is_arrow_on_top(arrow_location_)) ?
+ ((!is_horizontal && is_arrow_on_left(arrow_location_)) ||
+ (is_horizontal && is_arrow_on_top(arrow_location_))) ?
kArrowInteriorHeight : -kArrowInteriorHeight;
SkPath path;
@@ -464,7 +466,7 @@ void BubbleBorder::DrawArrowInterior(gfx::Canvas* canvas,
path.moveTo(SkDoubleToScalar(tip_x), SkDoubleToScalar(tip_y));
path.lineTo(SkDoubleToScalar(tip_x + offset_to_next_vertex),
SkDoubleToScalar(tip_y + offset_to_next_vertex));
- if (is_arrow_on_horizontal(arrow_location_)) {
+ if (is_horizontal) {
path.lineTo(SkDoubleToScalar(tip_x - offset_to_next_vertex),
SkDoubleToScalar(tip_y + offset_to_next_vertex));
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698