Opened 9 years ago

Closed 4 years ago

Last modified 3 years ago

#11739 closed defect (patchwelcome)

dojox.html.metrics.getTextBox() returns wrong height for texts including white-spaces

Reported by: Jan Schatz Owned by: Bryan Forbes
Priority: high Milestone: 1.13
Component: Dojox Version: 1.5
Keywords: Cc: Jan Schatz
Blocked By: Blocking:

Description

Due to the width of the measurement node being fixed to 1 pixel, the text that is to be measured will be wrapped if there are any white-space characters in it. This leads to a wrong text hight being returned. This issue could be fixed by disallowing automatic wrapping for the measurement node: m.style.whiteSpace = "nowrap";

Change History (5)

comment:1 Changed 9 years ago by Adam Peller

Milestone: 1.5.1tbd

comment:2 Changed 9 years ago by Adam Peller

Owner: changed from Adam Peller to bryanforbes

comment:3 Changed 9 years ago by bill

Owner: changed from bryanforbes to Bryan Forbes

comment:4 Changed 4 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: newclosed

Given that no one has shown interest in creating a patch in the past 5+ years, I'm closing this as patchwelcome.

comment:5 Changed 3 years ago by jan schatz

I provided a solution in the description text. I thought that would help. I cannot attach files to this ticket. So here is the patch that works for me:

--- dojox/html/metrics.js
+++ dojox/html/metrics.new.js
@@ -71,0 +72 @@
+			m.style.whiteSpace = "nowrap";
Note: See TracTickets for help on using tickets.