News:

Latest versions:
Server plugin: 0.5.1
MVP dongle: 0.5.2
Raspberry Pi client: 0.5.2
Windows client: 0.5.2-1

Main Menu

Patch: Fix drawing of too long lines

Started by muellerph, July 07, 2007, 23:31:02

Previous topic - Next topic

muellerph

Hello,

I attached a (small) patch to fix 2 drawing issues:

1. Recordlist: Endings of long recordingnames are not deleted when scrolled http://www.loggytronic.com/forum/index.php?PHPSESSID=8qoviesscgemsrti29so1ekn13&topic=232.0

2. Titlebars: In case the titelbar content is too long, the text had 5 pixels at left end, but not on the right end. Currently wasn't ugly like 1., but I still like it better this way.

How this was fixed:
I added implemented in the drawText function in surface.cc a width check and added the necessary functions with the new argument. All current drawText function still work, as with a width of 0, no length check is done.

Remarks:
1, Currently it is only a width check as I don't think that a height check makes sense
2. I didn't implemented a check for right aligned or centered text yet. Chris: If you want these as well, I will implement it for sure.
3. This check can now be used at other places as well, like for fixing e.g. http://sourceforge.net/tracker/index.php?func=detail&aid=1453263&group_id=139484&atid=743655, but I wait till you say you accept the implementation


(Changed: attachement removed because of new version available)

muellerph

#1
I have updated the patch against current CVS.
Also I changed the logic a bit. A check against 0 is ugly (C), so I defined default maximum width with 2000.

(changed: removed wrong patch)

hondansx

#2
Hi,

are you sure this is the right new patch?  ;)


--- box.cc      20 May 2006 20:17:28 -0000      1.13
+++ box.cc      7 Jul 2007 21:57:10 -0000


Thanks a lot
Walter
GA-EP43 | headless | 1xCineS2 Dual | 1xSkystar 2.6D | VDR 1.7.37 
Frontend: 1xRasperry | 1xION3

muellerph

Arg,

you are right. I uploaded the old one twice. Now attached the correct one.

Sorry,

Philipp

Chris

This patch is now in CVS, thanks Philipp!

It's not been that long has it ???  :o

muellerph

Quote from: Chris on January 12, 2008, 17:08:09
It's not been that long has it ???  :o
No issue with the timing. It's rather that I'm now not sure anymore if it is the right fix.

While I was playing with the scrollbar stuff I assume I got the right clue. There is no need to limit text drawing, as this should be handled automatically by WTextBox (or similar classes). WTextBox drawing is anyway limited by area (as all drawing widgets), so we just need to use the area limitation correctly.

The sad side is that if I only use area the text is drawn in the whole are. So no margin on left/right/top/bottom side.
Okay, we have wtextbox->settestpos, but this only works on top/left, but not on right/bottom (which would be needed for this fix).

So I'm only sure this fix is not really correct, while still thinking about a correct solution.

So not too late, but too late from my side to give these comments.

Anyway, better to have a fix for the drawing error now than to have just ideas for a correct solution ;)

Chris

Yeeeah, it's fine! Ok, you might change it later, fine!

When I write most of my code I fully intend to replace it one day!