indicate which sizing mode is in play

This commit is contained in:
Gavin McDonald
2025-09-02 16:45:00 -04:00
parent c5acb7ac33
commit 44f70b607c
3 changed files with 21 additions and 4 deletions

View File

@@ -49,6 +49,9 @@ defmodule LabelmakerWeb.Tools do
{:rows, _} ->
{:rows, process_rows(parameters["label"])}
{:sizing, _} ->
{:sizing, process_sizing(parameters)}
{:width, width} ->
{:width, process_width(width, parameters)}
@@ -140,6 +143,14 @@ defmodule LabelmakerWeb.Tools do
|> min(Constants.rows_max())
end
defp process_sizing(%{"_target" => [target | _tail]})
when target in ["width", "height", "radio_option"],
do: "wxh"
defp process_sizing(%{"_target" => ["size" | _tail]}), do: "font"
defp process_sizing(%{"sizing" => sizing}), do: sizing
def outline(_, error: true), do: outline(Constants.danger(), false)
def outline("none", _error), do: ""