Fix: cache le logo dans l'export si fontSize = 0#42
Open
mootookoi wants to merge 2 commits intozhouzi:mainfrom
Open
Fix: cache le logo dans l'export si fontSize = 0#42mootookoi wants to merge 2 commits intozhouzi:mainfrom
mootookoi wants to merge 2 commits intozhouzi:mainfrom
Conversation
zhouzi
requested changes
May 13, 2024
Comment on lines
+118
to
+119
| // Nécessaire pour l'export. Satori ne gère pas width: 0 | ||
| display: scale.fontSize(2.6) ? 'none' : 'block', |
Owner
There was a problem hiding this comment.
Bien vu pour le bug ! C'est clair que c'était pas très malin de ma part de permettre une taille de police à 0px.
C'est l'occasion de le corriger pour de bon, parce que j'ai peur qu'autrement on va introduire des abstractions qui vont continuer dans cette lignée tordue.
Ce qu'on peut faire c'est de limiter la taille de police entre 8px minimum et 24px maximum. Autrement dit 0% c'est 8px et 200% c'est 24px.
Pour ça il devrait suffire de changer fontSize dans scale :
scale.fontSize = function fontSize(factor: number) {
+ const min = 8;
+ const max = 24;
+ return scale(min + (((max - min) / 2) * theme.card.fontSize));
- return scale(16 * factor) * theme.card.fontSize;
};Ça fait un breaking change parce que le 0% et 200% d'avant n'auront plus la même signification. Mais c'était des usages "invalides", ça ne devrait pas poser de problème.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Satori ne gère pas width: '0px' pour les images.
Du coup, si on mettait la fontSize à 0, le logo apparaissait en gros dans l'export.
Personne ne devait faire des exports sans le texte mais c'est quand même un bug =p