@@ -341,7 +341,8 @@ MagickExport DrawInfo *CloneDrawInfo(const ImageInfo *image_info,
341
341
clone_info -> bounds = draw_info -> bounds ;
342
342
clone_info -> clip_units = draw_info -> clip_units ;
343
343
clone_info -> render = draw_info -> render ;
344
- clone_info -> alpha = draw_info -> alpha ;
344
+ clone_info -> fill_alpha = draw_info -> fill_alpha ;
345
+ clone_info -> stroke_alpha = draw_info -> stroke_alpha ;
345
346
clone_info -> element_reference = draw_info -> element_reference ;
346
347
clone_info -> debug = IsEventLogging ();
347
348
exception = DestroyExceptionInfo (exception );
@@ -2032,8 +2033,8 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
2032
2033
{
2033
2034
status &=QueryColorCompliance (token ,AllCompliance ,
2034
2035
& graphic_context [n ]-> fill ,exception );
2035
- if (graphic_context [n ]-> alpha != OpaqueAlpha )
2036
- graphic_context [n ]-> fill .alpha = graphic_context [n ]-> alpha ;
2036
+ if (graphic_context [n ]-> fill_alpha != OpaqueAlpha )
2037
+ graphic_context [n ]-> fill .alpha = graphic_context [n ]-> fill_alpha ;
2037
2038
if (status == MagickFalse )
2038
2039
{
2039
2040
ImageInfo
@@ -2054,7 +2055,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
2054
2055
{
2055
2056
GetNextToken (q ,& q ,extent ,token );
2056
2057
factor = strchr (token ,'%' ) != (char * ) NULL ? 0.01 : 1.0 ;
2057
- graphic_context [n ]-> fill . alpha = (double ) QuantumRange * (1.0 - factor *
2058
+ graphic_context [n ]-> fill_alpha = (double ) QuantumRange * (1.0 - factor *
2058
2059
StringToDouble (token ,& next_token ));
2059
2060
if (token == next_token )
2060
2061
status = MagickFalse ;
@@ -2235,8 +2236,11 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
2235
2236
{
2236
2237
GetNextToken (q ,& q ,extent ,token );
2237
2238
factor = strchr (token ,'%' ) != (char * ) NULL ? 0.01 : 1.0 ;
2238
- graphic_context [n ]-> alpha = ClampToQuantum (QuantumRange * (1.0 - (
2239
- QuantumScale * graphic_context [n ]-> alpha * (1.0 - factor *
2239
+ graphic_context [n ]-> fill_alpha = ClampToQuantum (QuantumRange * (1.0 - (
2240
+ QuantumScale * graphic_context [n ]-> fill_alpha * (1.0 - factor *
2241
+ StringToDouble (token ,& next_token )))));
2242
+ graphic_context [n ]-> stroke_alpha = ClampToQuantum (QuantumRange * (1.0 - (
2243
+ QuantumScale * graphic_context [n ]-> stroke_alpha * (1.0 - factor *
2240
2244
StringToDouble (token ,& next_token )))));
2241
2245
if (token == next_token )
2242
2246
status = MagickFalse ;
@@ -2592,8 +2596,9 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
2592
2596
{
2593
2597
status &=QueryColorCompliance (token ,AllCompliance ,
2594
2598
& graphic_context [n ]-> stroke ,exception );
2595
- if (graphic_context [n ]-> alpha != OpaqueAlpha )
2596
- graphic_context [n ]-> stroke .alpha = graphic_context [n ]-> alpha ;
2599
+ if (graphic_context [n ]-> stroke_alpha != OpaqueAlpha )
2600
+ graphic_context [n ]-> stroke .alpha =
2601
+ graphic_context [n ]-> stroke_alpha ;
2597
2602
if (status == MagickFalse )
2598
2603
{
2599
2604
ImageInfo
@@ -2716,7 +2721,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
2716
2721
{
2717
2722
GetNextToken (q ,& q ,extent ,token );
2718
2723
factor = strchr (token ,'%' ) != (char * ) NULL ? 0.01 : 1.0 ;
2719
- graphic_context [n ]-> stroke . alpha = (double ) QuantumRange * (1.0 - factor *
2724
+ graphic_context [n ]-> stroke_alpha = (double ) QuantumRange * (1.0 - factor *
2720
2725
StringToDouble (token ,& next_token ));
2721
2726
if (token == next_token )
2722
2727
status = MagickFalse ;
@@ -2842,12 +2847,10 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
2842
2847
}
2843
2848
if (status == MagickFalse )
2844
2849
break ;
2845
- if ((fabs (affine .sx - 1.0 ) >= DrawEpsilon ) ||
2846
- (fabs (affine .rx ) >= DrawEpsilon ) ||
2847
- (fabs (affine .ry ) >= DrawEpsilon ) ||
2850
+ if ((fabs (affine .sx - 1.0 ) >= DrawEpsilon ) ||
2851
+ (fabs (affine .rx ) >= DrawEpsilon ) || (fabs (affine .ry ) >= DrawEpsilon ) ||
2848
2852
(fabs (affine .sy - 1.0 ) >= DrawEpsilon ) ||
2849
- (fabs (affine .tx ) >= DrawEpsilon ) ||
2850
- (fabs (affine .ty ) >= DrawEpsilon ))
2853
+ (fabs (affine .tx ) >= DrawEpsilon ) || (fabs (affine .ty ) >= DrawEpsilon ))
2851
2854
{
2852
2855
graphic_context [n ]-> affine .sx = current .sx * affine .sx + current .ry * affine .rx ;
2853
2856
graphic_context [n ]-> affine .rx = current .rx * affine .sx + current .sy * affine .rx ;
@@ -4855,7 +4858,7 @@ static MagickBooleanType DrawStrokePolygon(Image *image,
4855
4858
break ;
4856
4859
stroke_polygon = (PrimitiveInfo * ) RelinquishMagickMemory (stroke_polygon );
4857
4860
q = p + p -> coordinates - 1 ;
4858
- closed_path = (fabs (q -> point .x - p -> point .x ) < DrawEpsilon ) &&
4861
+ closed_path = (fabs (q -> point .x - p -> point .x ) < DrawEpsilon ) &&
4859
4862
(fabs (q -> point .y - p -> point .y ) < DrawEpsilon ) ? MagickTrue : MagickFalse ;
4860
4863
if ((draw_info -> linecap == RoundCap ) && (closed_path == MagickFalse ))
4861
4864
{
@@ -4954,8 +4957,9 @@ MagickExport void GetDrawInfo(const ImageInfo *image_info,DrawInfo *draw_info)
4954
4957
(void ) QueryColorCompliance ("#0000" ,AllCompliance ,& draw_info -> stroke ,
4955
4958
exception );
4956
4959
draw_info -> stroke_width = 1.0 ;
4957
- draw_info -> alpha = OpaqueAlpha ;
4958
4960
draw_info -> fill_rule = EvenOddRule ;
4961
+ draw_info -> fill_alpha = OpaqueAlpha ;
4962
+ draw_info -> stroke_alpha = OpaqueAlpha ;
4959
4963
draw_info -> linecap = ButtCap ;
4960
4964
draw_info -> linejoin = MiterJoin ;
4961
4965
draw_info -> miterlimit = 10 ;
@@ -5137,7 +5141,7 @@ static void TraceArcPath(PrimitiveInfo *primitive_info,const PointInfo start,
5137
5141
size_t
5138
5142
arc_segments ;
5139
5143
5140
- if ((fabs (start .x - end .x ) < DrawEpsilon ) &&
5144
+ if ((fabs (start .x - end .x ) < DrawEpsilon ) &&
5141
5145
(fabs (start .y - end .y ) < DrawEpsilon ))
5142
5146
{
5143
5147
TracePoint (primitive_info ,end );
@@ -6103,22 +6107,22 @@ static PrimitiveInfo *TraceStrokePolygon(const DrawInfo *draw_info,
6103
6107
slope .q = 0.0 ;
6104
6108
inverse_slope .q = 0.0 ;
6105
6109
if (fabs (dx .q ) < DrawEpsilon )
6106
- {
6107
- if (dx .q >= 0.0 )
6110
+ {
6111
+ if (dx .q >= 0.0 )
6108
6112
slope .q = dy .q < 0.0 ? -1.0 /DrawEpsilon : 1.0 /DrawEpsilon ;
6109
6113
else
6110
6114
slope .q = dy .q < 0.0 ? 1.0 /DrawEpsilon : -1.0 /DrawEpsilon ;
6111
6115
}
6112
- else
6116
+ else
6113
6117
if (fabs (dy .q ) < DrawEpsilon )
6114
- {
6118
+ {
6115
6119
if (dy .q >= 0.0 )
6116
6120
inverse_slope .q = dx .q < 0.0 ? -1.0 /DrawEpsilon : 1.0 /DrawEpsilon ;
6117
6121
else
6118
6122
inverse_slope .q = dx .q < 0.0 ? 1.0 /DrawEpsilon : -1.0 /DrawEpsilon ;
6119
6123
}
6120
6124
else
6121
- {
6125
+ {
6122
6126
slope .q = dy .q /dx .q ;
6123
6127
inverse_slope .q = (-1.0 /slope .q );
6124
6128
}
0 commit comments