Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ScatterDraw & ScatterCtrl » [Bug] Text overflows legend box (RESOLVED)
[Bug] Text overflows legend box (RESOLVED) [message #52243] Thu, 15 August 2019 13:41 Go to next message
Maginor is currently offline  Maginor
Messages: 24
Registered: May 2019
Promising Member
Hi,

Especially on Windows 7, but also on Windows 10 (though not as much), long legend texts overflow the legend box. (If I place the legend in TOP position and have multiple series, their names overflow each other).

I have tried to dig into the ScatterDraw::DrawLegend function and it looks correct to me, but I may not understand all of it. Since it seems to be platform dependent, it could be that the GetTextSize function is incorrect, but wouldn't that cause all sorts of other problems throughout upp, which is something I don't see?

I just use the default font and font size, and I don't have responsiveness turned on.

Here is what it looks like on Windows 7
index.php?t=getfile&id=5892&private=0

[Updated on: Thu, 05 September 2019 11:16]

Report message to a moderator

Re: [Bug] Text overflows legend box [message #52244 is a reply to message #52243] Thu, 15 August 2019 15:00 Go to previous messageGo to next message
Maginor is currently offline  Maginor
Messages: 24
Registered: May 2019
Promising Member
Oh, I think I found the issue.

In ScatterDraw::DrawLegend() you call scaledFont.Bold() after calculating the size of the text, but the bold text is slightly wider.


Edit: Confirming that that was the issue.

[Updated on: Thu, 15 August 2019 15:06]

Report message to a moderator

Re: [Bug] Text overflows legend box [message #52247 is a reply to message #52244] Thu, 15 August 2019 20:14 Go to previous message
koldo is currently offline  koldo
Messages: 3045
Registered: August 2008
Ultimate Member
Thank you Maginor

Your fix is now included. In addition, GetTextSize() seems not to consider spaces, so a new GetTextSizeSpace() is included.
Please try it and tell us the results Smile


Best regards
IƱaki
Previous Topic: [Feature request] Gap in line at NaN values (RESOLVED)
Next Topic: Ideas: Grid lines at "round" dates or values. More options for tooltip.
Goto Forum:
  


Current Time: Sat Dec 14 07:01:53 CET 2019

Total time taken to generate the page: 0.01911 seconds