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

Unified Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 74533004: Make HTMLCanvasElement::convertLogicalToDevice() clamp float to integer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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: Source/core/html/HTMLCanvasElement.cpp
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index 85d444a1d1a0dd25a56f8204dedf14e0b354e1fa..b27a9f6d7520983403bda6c85e98a1f66227b365 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -406,9 +406,8 @@ PassRefPtr<ImageData> HTMLCanvasElement::getImageData()
IntSize HTMLCanvasElement::convertLogicalToDevice(const IntSize& logicalSize) const
{
- float width = ceilf(logicalSize.width() * m_deviceScaleFactor);
- float height = ceilf(logicalSize.height() * m_deviceScaleFactor);
- return IntSize(width, height);
+ FloatSize deviceSize = logicalSize * m_deviceScaleFactor;
+ return expandedIntSize(deviceSize);
}
SecurityOrigin* HTMLCanvasElement::securityOrigin() const
« 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