indicate which sizing mode is in play
This commit is contained in:
@@ -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: ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user