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

Unified Diff: sky/engine/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 878303002: Remove more scrolling code from Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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: sky/engine/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/sky/engine/core/html/canvas/CanvasRenderingContext2D.cpp b/sky/engine/core/html/canvas/CanvasRenderingContext2D.cpp
index f91322d72cec584de02eef6a468003602c523231..278b53257f37a5660ee7e308c5c049ef11f4b174 100644
--- a/sky/engine/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/sky/engine/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -1078,42 +1078,6 @@ bool CanvasRenderingContext2D::isPointInStrokeInternal(const Path& path, const f
return path.strokeContains(transformedPoint, strokeData);
}
-void CanvasRenderingContext2D::scrollPathIntoView()
-{
- scrollPathIntoViewInternal(m_path);
-}
-
-void CanvasRenderingContext2D::scrollPathIntoView(Path2D* path2d)
-{
- scrollPathIntoViewInternal(path2d->path());
-}
-
-void CanvasRenderingContext2D::scrollPathIntoViewInternal(const Path& path)
-{
- RenderObject* renderer = canvas()->renderer();
- RenderBox* renderBox = canvas()->renderBox();
- if (!renderer || !renderBox || !state().m_invertibleCTM || path.isEmpty())
- return;
-
- canvas()->document().updateLayout();
-
- // Apply transformation and get the bounding rect
- Path transformedPath = path;
- transformedPath.transform(state().m_transform);
- FloatRect boundingRect = transformedPath.boundingRect();
-
- // Offset by the canvas rect
- LayoutRect pathRect(boundingRect);
- IntRect canvasRect = renderBox->absoluteContentBox();
- pathRect.move(canvasRect.x(), canvasRect.y());
-
- renderer->scrollRectToVisible(
- pathRect, ScrollAlignment::alignCenterAlways, ScrollAlignment::alignTopAlways);
-
- // TODO: should implement "inform the user" that the caret and/or
- // selection the specified rectangle of the canvas. See http://crbug.com/357987
-}
-
void CanvasRenderingContext2D::clearRect(float x, float y, float width, float height)
{
if (!validateRectForCanvas(x, y, width, height))
« no previous file with comments | « sky/engine/core/html/canvas/CanvasRenderingContext2D.h ('k') | sky/engine/core/html/canvas/CanvasRenderingContext2D.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698