Gradient Part 5c: Fix gradient rotation on text & math#2606
Gradient Part 5c: Fix gradient rotation on text & math#2606laurmaedje merged 20 commits intotypst:mainfrom
Conversation
…nto gradient-math-fix
|
This also changes the way rotation of gradient is handled in PDF to use the same technique used for SVGs. This technique, I have found, tends to bit more robust to weird transform matrices which should help too. |
I totally agree. I'm really not a fan of the new |
|
Ok now it's truly fixed in a way that should also avoid any future bug that are PDF transform related. |
|
This actually fixes a bunch of potential bugs with gradients on text that nobody seems to have noticed yet. At least they're already fixed, sorry for introducing bugs, but transforms are hard sigh |
|
Thank you, it's great than you managed to make it simpler instead of more complicated than the previous state. :) |
@laurmaedje I am mostly glad I managed to fix it "at the source" and prevent other similar bugs from eventually creeping up! |
Math mode uses a different transform which was not compatible with the old way of handling gradients on text. Now there is an added parameter on
TextItemwhich keeps track of whether the text item is part of a math equation. I would have preferred if math and text shared the transform "system" but I can't figure out why they differ especially since this is specific to PDF. In any case, that should fix the issue while remaining compatible.