Bug 1379715 - Grid Inspector Area Names are giant when they overflow. r?gl draft
authorMicah Tigley <tigleym@gmail.com>
Tue, 11 Jul 2017 22:17:17 -0600
changeset 607239 d01974c83d979af380954c7edd763e98570361a4
parent 607216 9dd2156225d334fc9c164017b7c5068273bfb7ca
child 636987 e4a6fc6e07165e9a2a4a3e30065a3f06334c5b03
push id67942
push userbmo:tigleym@gmail.com
push dateWed, 12 Jul 2017 04:18:27 +0000
reviewersgl
bugs1379715
milestone56.0a1
Bug 1379715 - Grid Inspector Area Names are giant when they overflow. r?gl MozReview-Commit-ID: EFQkZ25Bf4w
devtools/server/actors/highlighters/css-grid.js
--- a/devtools/server/actors/highlighters/css-grid.js
+++ b/devtools/server/actors/highlighters/css-grid.js
@@ -1226,17 +1226,18 @@ CssGridHighlighter.prototype = extend(Au
 
     // Draw the text for the grid area name.
     for (let rowNumber = rowStart; rowNumber < rowEnd; rowNumber++) {
       for (let columnNumber = columnStart; columnNumber < columnEnd; columnNumber++) {
         let row = fragment.rows.tracks[rowNumber - 1];
         let column = fragment.cols.tracks[columnNumber - 1];
 
         // Check if the font size is exceeds the bounds of the containing grid cell.
-        if (fontSize > column.breadth || fontSize > row.breadth) {
+        if (fontSize > (column.breadth * displayPixelRatio) ||
+            fontSize > (row.breadth * displayPixelRatio)) {
           fontSize = (column.breadth + row.breadth) / 2;
           this.ctx.font = fontSize + "px " + GRID_FONT_FAMILY;
         }
 
         let textWidth = this.ctx.measureText(area.name).width;
 
         // The width of the character 'm' approximates the height of the text.
         let textHeight = this.ctx.measureText("m").width;