drawshield / Drawshield-Code

PHP code to create SVG shield images from Blazons, as used on drawshield.net
https://drawshield.net
GNU General Public License v3.0
49 stars 17 forks source link

Bug: grady countercharged displays as checky #679

Open steve-the-player opened 3 weeks ago

steve-the-player commented 3 weeks ago

When I ask it for a grady countercharged (using a grady of sable and white for an example), the countercharged ordinary behaves as if the original pattern was checky. I have tested this with multiple types of ordinaries and multiple directions of gradient, and it appears to be consistently bugged across all of them shield-grady_in_annulo-chevron_countercharged-BROKEN Grady in annulo sable argent, a chevron countercharged

Manually overwriting the blazon results in something like this shield-grady_in_annulo-chevron_countercharged-manual_override-NOTQUITERIGHT Grady in annulo sable argent, a chevron grady in annulo argent sable which is a lot closer, but still not quite right. Notably, when using a grady in annulo, or radial gradient, the center point of the chevron's gradient is lower than that of the field. When countercharging, it should merely appear to swap the two colors (or in this case reverse the direction of the gradient).

karlwilcox commented 3 weeks ago

Interesting. The grady thing was just a random idea had (not at all heraldic) so I didn't fully implement it. I think what is happening is that counterchanged looks for a two colour field, but grady isn't one (because you can have grady of a single colour), hence it falls back to checky ang gives an error message.

I could add some additional code to ensure the match, but then you run into the second problem that you note, which is that the centre of the circular fill is the center of the filled object's bounding box (which in most cases is what you actually want, e.g. on a roundel), but with counterchanged you want the centre to be in exactly the same place as the underlying field, and then use the object as a mask instead of filling it.

So, in short, yes, that is a bug, sorry. However, fixing it is probably quite fiddly (and still not heraldic) so to be honest, I'm probably not going to have time to look at this but I'm happy to leave it on the issues list for now.

Thanks for getting in touch!

steve-the-player commented 2 weeks ago

Yeah, I don’t really consider it urgent. I just thought I’d make sure it was documented as something to do later.