Commit 5311afb6 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

enforce unit conversion in draw_text

parent c4919277
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ ReturnCode draw_text(
    HAlign align_x,
    VAlign align_y,
    double rotate,
    const TextStyle& text_style);
    TextStyle text_style);

ReturnCode draw_text(
    Context* ctx,
@@ -79,7 +79,7 @@ ReturnCode draw_text(
    const Point& position,
    HAlign align_x,
    VAlign align_y,
    const TextStyle& text_style);
    TextStyle text_style);

} // namespace clip
+4 −2
Original line number Diff line number Diff line
@@ -59,7 +59,9 @@ ReturnCode draw_text(
    HAlign align_x,
    VAlign align_y,
    double rotate,
    const TextStyle& style) {
    TextStyle style) {
  convert_unit_typographic(ctx->dpi, ctx->font_size, &style.font_size);

  text::TextSpan span;
  span.text_direction = style.direction;
  span.text = text;
@@ -124,7 +126,7 @@ ReturnCode draw_text(
    const Point& position,
    HAlign align_x,
    VAlign align_y,
    const TextStyle& text_style) {
    TextStyle text_style) {
  return draw_text(
      ctx,
      text,