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

Unified Diff: Source/platform/DragImage.cpp

Issue 517193002: Use correct font for label in a drag image (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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: Source/platform/DragImage.cpp
diff --git a/Source/platform/DragImage.cpp b/Source/platform/DragImage.cpp
index 82319cd5fa7df60e5eba1f51b55cf6f35f30ba9f..7b58d3c63966f4fd7cc54802732d3510e61df311 100644
--- a/Source/platform/DragImage.cpp
+++ b/Source/platform/DragImage.cpp
@@ -189,11 +189,11 @@ PassOwnPtr<DragImage> DragImage::create(const KURL& url, const String& inLabel,
TextRun textRun = textRunWithDirectionality(label, hasStrongDirectionality);
IntPoint textPos(kDragLabelBorderX, kDragLabelBorderY + labelFont.fontDescription().computedPixelSize());
if (hasStrongDirectionality && textRun.direction() == RTL) {
- float textWidth = urlFont.width(textRun);
+ float textWidth = labelFont.width(textRun);
int availableWidth = imageSize.width() - kDragLabelBorderX * 2;
textPos.setX(availableWidth - ceilf(textWidth));
}
- buffer->context()->drawBidiText(urlFont, TextRunPaintInfo(textRun), textPos);
+ buffer->context()->drawBidiText(labelFont, TextRunPaintInfo(textRun), textPos);
RefPtr<Image> image = buffer->copyImage();
return DragImage::create(image.get(), DoNotRespectImageOrientation, deviceScaleFactor);
« 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