1
0
Fork 0
mirror of https://git.code.sf.net/p/zint/code synced 2025-06-01 07:38:26 -04:00

emf/eps: fix previous gws_left/right_fudge hack

This commit is contained in:
gitlost 2023-12-15 18:52:41 +00:00
parent 40a4bb9da0
commit c9f0e61d78
17 changed files with 296 additions and 81 deletions
backend

View file

@ -656,9 +656,11 @@ INTERNAL int emf_plot(struct zint_symbol *symbol, int rotate_angle) {
text[this_text].ey_scale = 1.0f;
/* Unhack the guard whitespace `gws_left_fudge`/`gws_right_fudge` hack */
if (upcean && string->halign == 1 && string->text[0] == '<') {
text[this_text].w_emr_text.reference.x = 0;
const float gws_left_fudge = symbol->scale < 0.1f ? 0.1f : symbol->scale; /* 0.5 * 2 * scale */
text[this_text].w_emr_text.reference.x = (int32_t) (string->x + gws_left_fudge);
} else if (upcean && string->halign == 2 && string->text[0] == '>') {
text[this_text].w_emr_text.reference.x = (int32_t) (symbol->vector->width - 1);
const float gws_right_fudge = symbol->scale < 0.1f ? 0.1f : symbol->scale; /* 0.5 * 2 * scale */
text[this_text].w_emr_text.reference.x = (int32_t) (string->x - gws_right_fudge);
} else {
text[this_text].w_emr_text.reference.x = (int32_t) string->x;
}