Handle seting of an empty dash in [setLineDash:count:phase:].

[_doPath] now always sends the dash pattern, even when empty.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14699 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2002-10-10 09:47:48 +00:00
parent d9dda82498
commit 480b90b2b8

View file

@ -450,7 +450,19 @@ static float default_miter_limit = 10.0;
{
NSZone *myZone = [self zone];
if ( _dash_pattern == NULL)
if ((pattern == NULL) || (count == 0))
{
if (_dash_pattern != NULL)
{
NSZoneFree(myZone, _dash_pattern);
_dash_pattern = NULL;
}
_dash_count = 0;
_dash_phase = 0.0;
return;
}
if (_dash_pattern == NULL)
_dash_pattern = NSZoneMalloc(myZone, count * sizeof(float));
else
NSZoneRealloc(myZone, _dash_pattern, count * sizeof(float));
@ -1399,8 +1411,8 @@ static float default_miter_limit = 10.0;
DPSsetflat(ctxt, [self flatness]);
[self getLineDash: pattern count: &count phase: &phase];
if (count != 0 && count < 10)
DPSsetdash(ctxt, pattern, count, phase);
// Always sent the dash pattern. When NULL this will reset to a solid line.
DPSsetdash(ctxt, pattern, count, phase);
count = [self elementCount];
for(i = 0; i < count; i++)