Re: Bug 28791: ensure that dashes value is not 0 for PS_USERSTYLE linestyles

2011-10-19 Thread Alexandre Julliard
damian dixon damian.di...@gmail.com writes:

 diff --git a/dlls/winex11.drv/pen.c b/dlls/winex11.drv/pen.c
 index b677515..71b1bea 100644
 --- a/dlls/winex11.drv/pen.c
 +++ b/dlls/winex11.drv/pen.c
 @@ -108,7 +108,7 @@ HPEN X11DRV_SelectPen( PHYSDEV dev, HPEN hpen )
case PS_USERSTYLE:
  physDev-pen.dash_len = min(elp-elpNumEntries, MAX_DASHLEN);
  for(i = 0; i  physDev-pen.dash_len ; i++)
 -physDev-pen.dashes[i] = min(elp-elpStyleEntry[i], 255);
 +physDev-pen.dashes[i] = min(elp-elpStyleEntry[i], 255) ? 
 min(elp-elpStyleEntry[i], 255) : 1;

Removing 0 entries (and merging the adjacent entries) would probably be
more correct. It could also use some test cases.

-- 
Alexandre Julliard
julli...@winehq.org




Re: Bug 28791: ensure that dashes value is not 0 for PS_USERSTYLE linestyles

2011-10-19 Thread Damian Dixon
Just removing the zeros will shift the pattern to the left potentially
producing
an effect that is not expected. I will take a look at what happens on
Windows
to see what needs to be replicated.

On 19 October 2011 20:05, Alexandre Julliard julli...@winehq.org wrote:

 damian dixon damian.di...@gmail.com writes:

  diff --git a/dlls/winex11.drv/pen.c b/dlls/winex11.drv/pen.c
  index b677515..71b1bea 100644
  --- a/dlls/winex11.drv/pen.c
  +++ b/dlls/winex11.drv/pen.c
  @@ -108,7 +108,7 @@ HPEN X11DRV_SelectPen( PHYSDEV dev, HPEN hpen )
 case PS_USERSTYLE:
   physDev-pen.dash_len = min(elp-elpNumEntries,
 MAX_DASHLEN);
   for(i = 0; i  physDev-pen.dash_len ; i++)
  -physDev-pen.dashes[i] = min(elp-elpStyleEntry[i],
 255);
  +physDev-pen.dashes[i] = min(elp-elpStyleEntry[i], 255)
 ? min(elp-elpStyleEntry[i], 255) : 1;

 Removing 0 entries (and merging the adjacent entries) would probably be
 more correct. It could also use some test cases.

 --
 Alexandre Julliard
 julli...@winehq.org