mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 20:37:39 +00:00
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:
parent
d9dda82498
commit
480b90b2b8
1 changed files with 15 additions and 3 deletions
|
@ -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++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue