Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: tiny bug in volume bar (fix)



Jon Burgess wrote:
> 
> Klaus Schmidinger wrote:
> 
> >>--- menu.c~     2003-09-14 12:42:02.000000000 +0100
> >>+++ menu.c      2003-09-14 12:49:11.707073096 +0100
> >>@@ -2868,7 +2868,7 @@
> >> :cBitmap(Width, Height, 2)
> >> {
> >>   int l = Prompt ? cBitmap::Width(Prompt) : 0;
> >>-  int p = (Width - l) * Current / Total;
> >>+  int p = (Width - l - 1) * Current / Total;
> >>   Text(0, 0, Prompt, clrGreen);
> >>   Fill(l, 0, p, Height - 1, clrGreen);
> >>   Fill(l + p, 0, Width - 1, Height - 1, clrWhite);
> >
> >
> > I've looked at this over and over again, but I fail to
> > see why subtracting 1 there would make that big a difference here.
> >
> > Can you please test whether just changing the line
> >
> >     Fill(l + p, 0, Width - 1, Height - 1, clrWhite);
> > to
> >     Fill(l + p, 0, Width - l - p - 1, Height - 1, clrWhite);
> >
> > also fixes this?
> > Don't forget to revert the above change first.
> >
> > Klaus
> >
> >
> 
> I'm not in front of the machine to test it right now. I think my fix is
> the correct one.
> i.e. the display is "width", which has pixels 0 ... width-1
> When called with current==total, the current code gives:
>    p = (Width - l)
> 
> In the second fill:
>    Fill(l+p, o , Width -1, height -1, clrwhite);
> 
> The first X co-ordinate is
>    l+p == l + Width - l == Width
> 
> I think this is wrong, because it is outside of the range 0...width-1
> Whether this should cause a problem can be argued both ways, presumably
> the full-featured OSD isn't bothered by this, but the dxr3 osd is.

The second Fill() draws the white part of the volume bar, which represents
the range the volume can still be increased to.

With Current==Total the volume is already at its maximum value, so
there should be _no_ white part of the bar. It is therefore _wrong_
to call Fill() with a starting offset of Width-1.

The DVB device's OSD just ignores any drawing action outside the defined
areas, and so should the DXR3 device.

Klaus


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index