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

Unified Diff: ui/gfx/canvas.cc

Issue 2689273002: Fix appearance of header row separators in table view at fractional (Closed)
Patch Set: Created 3 years, 10 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: ui/gfx/canvas.cc
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc
index 43d799716b479999dc736c5aed223e47428c5811..c83118749e7f2d904f44a582202b6b7d7819d3b1 100644
--- a/ui/gfx/canvas.cc
+++ b/ui/gfx/canvas.cc
@@ -321,6 +321,22 @@ void Canvas::DrawLine(const PointF& p1,
SkFloatToScalar(p2.x()), SkFloatToScalar(p2.y()), flags);
}
+void Canvas::DrawSharpLine(const PointF& p1, const PointF& p2, SkColor color) {
+ ScopedCanvas scoped(this);
+ float dsf = UndoDeviceScaleFactor();
+
+ PointF start = p1;
Peter Kasting 2017/02/15 00:43:59 Nit: If you're just going to copy these anyway, I
Evan Stade 2017/02/15 16:54:46 I thought we never passed non-PODs by value and co
+ start.Scale(dsf);
+ PointF end = p2;
+ end.Scale(dsf);
+
+ cc::PaintFlags flags;
+ flags.setColor(color);
+ flags.setStrokeWidth(std::floor(dsf));
Evan Stade 2017/02/14 23:06:03 I guess I could use gfx::ToFlooredInt for this, bu
Peter Kasting 2017/02/15 00:43:59 floor() returns a float, which is potentially outs
Evan Stade 2017/02/15 16:54:46 Done.
+
+ DrawLine(start, end, flags);
+}
+
void Canvas::DrawCircle(const Point& center_point,
int radius,
const cc::PaintFlags& flags) {
« ui/gfx/canvas.h ('K') | « ui/gfx/canvas.h ('k') | ui/views/controls/table/table_header.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698