logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0001-Make-stroke_width-a-float.patch (1620B)


  1. From 70be0635bf09e67202181de17b0ed4e6bafcd9b8 Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Mon, 12 Jun 2017 02:42:32 -0700
  4. Subject: [PATCH] Make stroke_width a float
  5. ---
  6. include/svgtiny.h | 2 +-
  7. src/svgtiny.c | 3 +--
  8. src/svgtiny_internal.h | 2 +-
  9. 3 files changed, 3 insertions(+), 4 deletions(-)
  10. diff --git a/include/svgtiny.h b/include/svgtiny.h
  11. index 85f146f..6acf42e 100644
  12. --- a/include/svgtiny.h
  13. +++ b/include/svgtiny.h
  14. @@ -29,7 +29,7 @@ struct svgtiny_shape {
  15. float text_x, text_y;
  16. svgtiny_colour fill;
  17. svgtiny_colour stroke;
  18. - int stroke_width;
  19. + float stroke_width;
  20. };
  21. struct svgtiny_diagram {
  22. diff --git a/src/svgtiny.c b/src/svgtiny.c
  23. index 8831b92..838e149 100644
  24. --- a/src/svgtiny.c
  25. +++ b/src/svgtiny.c
  26. @@ -1698,8 +1698,7 @@ struct svgtiny_shape *svgtiny_add_shape(struct svgtiny_parse_state *state)
  27. shape->text = 0;
  28. shape->fill = state->fill;
  29. shape->stroke = state->stroke;
  30. - shape->stroke_width = lroundf((float) state->stroke_width *
  31. - (state->ctm.a + state->ctm.d) / 2.0);
  32. + shape->stroke_width = state->stroke_width * (state->ctm.a + state->ctm.d) / 2.0;
  33. if (0 < state->stroke_width && shape->stroke_width == 0)
  34. shape->stroke_width = 1;
  35. diff --git a/src/svgtiny_internal.h b/src/svgtiny_internal.h
  36. index 6bf5d64..c0ef754 100644
  37. --- a/src/svgtiny_internal.h
  38. +++ b/src/svgtiny_internal.h
  39. @@ -51,7 +51,7 @@ struct svgtiny_parse_state {
  40. /* paint attributes */
  41. svgtiny_colour fill;
  42. svgtiny_colour stroke;
  43. - int stroke_width;
  44. + float stroke_width;
  45. /* gradients */
  46. struct svgtiny_parse_state_gradient fill_grad;
  47. --
  48. 2.18.0