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

Unified Diff: ui/gfx/canvas.cc

Issue 2689273002: Fix appearance of header row separators in table view at fractional (Closed)
Patch Set: pkasting review 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
« no previous file with comments | « ui/gfx/canvas.h ('k') | ui/views/controls/table/table_header.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas.cc
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc
index 43d799716b479999dc736c5aed223e47428c5811..ed9cea122815fb411d68469ee87438dfd8ab3131 100644
--- a/ui/gfx/canvas.cc
+++ b/ui/gfx/canvas.cc
@@ -321,6 +321,19 @@ void Canvas::DrawLine(const PointF& p1,
SkFloatToScalar(p2.x()), SkFloatToScalar(p2.y()), flags);
}
+void Canvas::DrawSharpLine(PointF p1, PointF p2, SkColor color) {
+ ScopedCanvas scoped(this);
+ float dsf = UndoDeviceScaleFactor();
+ p1.Scale(dsf);
+ p2.Scale(dsf);
+
+ cc::PaintFlags flags;
+ flags.setColor(color);
+ flags.setStrokeWidth(SkFloatToScalar(std::floor(dsf)));
+
+ DrawLine(p1, p2, flags);
+}
+
void Canvas::DrawCircle(const Point& center_point,
int radius,
const cc::PaintFlags& flags) {
@@ -360,16 +373,13 @@ void Canvas::DrawFocusRect(const RectF& rect) {
DrawDashedRect(rect, SK_ColorGRAY);
}
-void Canvas::DrawSolidFocusRect(const RectF& rect,
- SkColor color,
- float thickness) {
+void Canvas::DrawSolidFocusRect(RectF rect, SkColor color, float thickness) {
cc::PaintFlags flags;
flags.setColor(color);
flags.setStrokeWidth(SkFloatToScalar(thickness));
flags.setStyle(cc::PaintFlags::kStroke_Style);
- gfx::RectF draw_rect = rect;
- draw_rect.Inset(gfx::InsetsF(thickness / 2));
- DrawRect(draw_rect, flags);
+ rect.Inset(gfx::InsetsF(thickness / 2));
+ DrawRect(rect, flags);
}
void Canvas::DrawImageInt(const ImageSkia& image, int x, int y) {
« no previous file with comments | « 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