diff --git a/lib/scenic/graph/bounds.ex b/lib/scenic/graph/bounds.ex index 011b5591..a12b63a3 100644 --- a/lib/scenic/graph/bounds.ex +++ b/lib/scenic/graph/bounds.ex @@ -337,10 +337,10 @@ defmodule Scenic.Graph.Bounds do # special case vertical lines so we don't divide by zero sa = case Vector2.normalize(v_c_start) do - {0.0, 1.0} -> + {+0.0, 1.0} -> @tau_14 - {0.0, -1.0} -> + {+0.0, -1.0} -> -1 * @tau_14 {x, y} -> diff --git a/lib/scenic/math/matrix.ex b/lib/scenic/math/matrix.ex index 2693bf5a..d58aad4c 100644 --- a/lib/scenic/math/matrix.ex +++ b/lib/scenic/math/matrix.ex @@ -41,40 +41,40 @@ defmodule Scenic.Math.Matrix do @matrix_size 4 * 16 @matrix_zero << - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native >> @matrix_identity << 1.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, 1.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, 1.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, 1.0::float-size(32)-native >> @@ -116,19 +116,19 @@ defmodule Scenic.Math.Matrix do # << # v0x::float-size(32)-native, # v0y::float-size(32)-native, - # 0.0::float-size(32)-native, - # 0.0::float-size(32)-native, + # +0.0::float-size(32)-native, + # +0.0::float-size(32)-native, # v1x::float-size(32)-native, # v1y::float-size(32)-native, - # 0.0::float-size(32)-native, - # 0.0::float-size(32)-native, - # 0.0::float-size(32)-native, - # 0.0::float-size(32)-native, + # +0.0::float-size(32)-native, + # +0.0::float-size(32)-native, + # +0.0::float-size(32)-native, + # +0.0::float-size(32)-native, # 1.0::float-size(32)-native, - # 0.0::float-size(32)-native, - # 0.0::float-size(32)-native, - # 0.0::float-size(32)-native, - # 0.0::float-size(32)-native, + # +0.0::float-size(32)-native, + # +0.0::float-size(32)-native, + # +0.0::float-size(32)-native, + # +0.0::float-size(32)-native, # 1.0::float-size(32)-native # >> # end @@ -140,18 +140,18 @@ defmodule Scenic.Math.Matrix do # v0x::float-size(32)-native, # v0y::float-size(32)-native, # v0z::float-size(32)-native, - # 0.0::float-size(32)-native, + # +0.0::float-size(32)-native, # v1x::float-size(32)-native, # v1y::float-size(32)-native, # v1z::float-size(32)-native, - # 0.0::float-size(32)-native, + # +0.0::float-size(32)-native, # v2x::float-size(32)-native, # v2y::float-size(32)-native, # v2z::float-size(32)-native, - # 0.0::float-size(32)-native, - # 0.0::float-size(32)-native, - # 0.0::float-size(32)-native, - # 0.0::float-size(32)-native, + # +0.0::float-size(32)-native, + # +0.0::float-size(32)-native, + # +0.0::float-size(32)-native, + # +0.0::float-size(32)-native, # 1.0::float-size(32)-native # >> # end @@ -200,26 +200,26 @@ defmodule Scenic.Math.Matrix do """ @spec build_translation(vector_2 :: Math.vector_2()) :: Math.matrix() def build_translation(vector_2) - def build_translation({x, y}), do: do_build_translation({x, y, 0.0}) + def build_translation({x, y}), do: do_build_translation({x, y, +0.0}) # def build_translation({x, y, z}), do: build_translation(x, y, z) - # def build_translation(x, y), do: build_translation(x, y, 0.0) + # def build_translation(x, y), do: build_translation(x, y, +0.0) defp do_build_translation({x, y, z}) do << 1.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, x * 1.0::float-size(32)-native, - 0.0::float-size(32)-native, + +0.0::float-size(32)-native, 1.0::float-size(32)-native, - 0.0::float-size(32)-native, + +0.0::float-size(32)-native, y * 1.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, 1.0::float-size(32)-native, z * 1.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, 1.0::float-size(32)-native >> end @@ -243,20 +243,20 @@ defmodule Scenic.Math.Matrix do defp do_build_scale({x, y, z}) do << x * 1.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, y * 1.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, z * 1.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, 1.0::float-size(32)-native >> end @@ -290,23 +290,23 @@ defmodule Scenic.Math.Matrix do # sin = :math.sin( radians ) # << # 1.0 :: float-size(32)-native, - # 0.0 :: float-size(32)-native, - # 0.0 :: float-size(32)-native, - # 0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, - # 0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, # cos :: float-size(32)-native, # sin :: float-size(32)-native, - # 0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, - # 0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, # -sin :: float-size(32)-native, # cos :: float-size(32)-native, - # 0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, - # 0.0 :: float-size(32)-native, - # 0.0 :: float-size(32)-native, - # 0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, # 1.0 :: float-size(32)-native # >> # end @@ -316,23 +316,23 @@ defmodule Scenic.Math.Matrix do # sin = :math.sin( radians ) # << # cos :: float-size(32)-native, - # 0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, # sin :: float-size(32)-native, - # 0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, - # 0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, # 1.0 :: float-size(32)-native, - # 0.0 :: float-size(32)-native, - # 0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, # -sin :: float-size(32)-native, - # 0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, # cos :: float-size(32)-native, - # 0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, - # 0.0 :: float-size(32)-native, - # 0.0 :: float-size(32)-native, - # 0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, + # +0.0 :: float-size(32)-native, # 1.0 :: float-size(32)-native # >> # end @@ -344,19 +344,19 @@ defmodule Scenic.Math.Matrix do << cos::float-size(32)-native, -sin::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, sin::float-size(32)-native, cos::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, 1.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, - 0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, + +0.0::float-size(32)-native, 1.0::float-size(32)-native >> end @@ -579,14 +579,14 @@ defmodule Scenic.Math.Matrix do Parameters: * matrix_a: The first matrix * matrix_b: The second matrix - * tolerance: Defines what close means. Defaults to: 0.000001 + * tolerance: Defines what close means. Defaults to: +0.000001 Returns: A boolean """ @spec close?(matrix_a :: Math.matrix(), matrix_a :: Math.matrix(), tolerance :: number) :: boolean - def close?(matrix_a, matrix_b, tolerance \\ 0.000001) + def close?(matrix_a, matrix_b, tolerance \\ +0.000001) def close?(<<_::binary-size(@matrix_size)>> = a, <<_::binary-size(@matrix_size)>> = b, t) when is_float(t) do @@ -790,7 +790,7 @@ defmodule Scenic.Math.Matrix do @spec invert(matrix :: Math.matrix()) :: Math.matrix() def invert(matrix) do case nif_determinant(matrix) do - 0.0 -> + +0.0 -> :err_zero_determinant det -> diff --git a/lib/scenic/math/vector_2.ex b/lib/scenic/math/vector_2.ex index 252d2674..350ae522 100644 --- a/lib/scenic/math/vector_2.ex +++ b/lib/scenic/math/vector_2.ex @@ -264,7 +264,7 @@ defmodule Scenic.Math.Vector2 do def normalize({ax, ay}) do case Vector2.length({ax, ay}) do - 0.0 -> + +0.0 -> {ax, ay} len -> diff --git a/lib/scenic/scene.ex b/lib/scenic/scene.ex index 19c64758..ae277bae 100644 --- a/lib/scenic/scene.ex +++ b/lib/scenic/scene.ex @@ -724,7 +724,7 @@ defmodule Scenic.Scene do def request_input(%Scene{viewport: vp, pid: pid, module: module}, inputs) when is_list(inputs) do unless Kernel.function_exported?(module, :handle_input, 3) do - Logger.warn("Requesting input for #{inspect inputs} - #{module}.handle_input/3 not implemented") + Logger.warning("Requesting input for #{inspect inputs} - #{module}.handle_input/3 not implemented") end ViewPort.Input.request(vp, inputs, pid: pid) end diff --git a/test/scenic/color_test.exs b/test/scenic/color_test.exs index b5b30f71..47e92488 100644 --- a/test/scenic/color_test.exs +++ b/test/scenic/color_test.exs @@ -113,10 +113,10 @@ defmodule Scenic.ColorTest do assert Color.to_hsv(0) == {:color_hsv, {0, 0, 0}} - {:color_hsv, {0.0, 0.0, v}} = Color.to_hsv(128) + {:color_hsv, {+0.0, +0.0, v}} = Color.to_hsv(128) assert v > 50 && v < 51 - {:color_hsv, {0.0, 0.0, v}} = Color.to_hsv({128, 200}) + {:color_hsv, {+0.0, +0.0, v}} = Color.to_hsv({128, 200}) assert v > 50 && v < 51 assert Color.to_hsv(:bisque) |> Color.to_rgb() == rgb @@ -130,10 +130,10 @@ defmodule Scenic.ColorTest do hsl = Color.to_hsl(:bisque) rgb = Color.to_rgb(:bisque) - {:color_hsv, {0.0, 0.0, v}} = Color.to_hsv({:color_g, 128}) + {:color_hsv, {+0.0, +0.0, v}} = Color.to_hsv({:color_g, 128}) assert v > 50 && v < 51 - {:color_hsv, {0.0, 0.0, v}} = Color.to_hsv({:color_ga, {128, 200}}) + {:color_hsv, {+0.0, +0.0, v}} = Color.to_hsv({:color_ga, {128, 200}}) assert v > 50 && v < 51 assert Color.to_hsv(rgb) |> Color.to_rgb() == rgb @@ -148,10 +148,10 @@ defmodule Scenic.ColorTest do assert Color.to_hsl(0) == {:color_hsl, {0, 0, 0}} - {:color_hsl, {0.0, 0.0, l}} = Color.to_hsl(128) + {:color_hsl, {+0.0, +0.0, l}} = Color.to_hsl(128) assert l > 50 && l < 51 - {:color_hsl, {0.0, 0.0, l}} = Color.to_hsl({128, 200}) + {:color_hsl, {+0.0, +0.0, l}} = Color.to_hsl({128, 200}) assert l > 50 && l < 51 assert Color.to_hsl(:bisque) |> Color.to_rgb() == rgb @@ -164,10 +164,10 @@ defmodule Scenic.ColorTest do # from bisque rgb = Color.to_rgb(:bisque) - {:color_hsl, {0.0, 0.0, l}} = Color.to_hsl({:color_g, 128}) + {:color_hsl, {+0.0, +0.0, l}} = Color.to_hsl({:color_g, 128}) assert l > 50 && l < 51 - {:color_hsl, {0.0, 0.0, l}} = Color.to_hsl({:color_ga, {128, 200}}) + {:color_hsl, {+0.0, +0.0, l}} = Color.to_hsl({:color_ga, {128, 200}}) assert l > 50 && l < 51 assert Color.to_hsl({:color_rgb, {0xFF, 0xE4, 0xC4}}) |> Color.to_rgb() == rgb diff --git a/test/scenic/component/button_test.exs b/test/scenic/component/button_test.exs index 01e00f18..b6a0b6cd 100644 --- a/test/scenic/component/button_test.exs +++ b/test/scenic/component/button_test.exs @@ -123,7 +123,7 @@ defmodule Scenic.Component.ButtonTest do Graph.build() |> Scenic.Components.button("Test Button") - {0.0, 0.0, r, b} = Graph.bounds(graph) + {+0.0, +0.0, r, b} = Graph.bounds(graph) assert r > 140 && r < 141 assert b > 38 && b < 39 end @@ -133,6 +133,6 @@ defmodule Scenic.Component.ButtonTest do Graph.build() |> Scenic.Components.button("Test Button", width: 200, height: 100) - assert Graph.bounds(graph) == {0.0, 0.0, 200.0, 100.0} + assert Graph.bounds(graph) == {+0.0, +0.0, 200.0, 100.0} end end diff --git a/test/scenic/component/input/checkbox_test.exs b/test/scenic/component/input/checkbox_test.exs index aec2f587..8e53923b 100644 --- a/test/scenic/component/input/checkbox_test.exs +++ b/test/scenic/component/input/checkbox_test.exs @@ -112,7 +112,7 @@ defmodule Scenic.Component.Input.CheckboxTest do Graph.build() |> Scenic.Components.checkbox({"Test Checkbox", false}) - {0.0, 0.0, r, b} = Graph.bounds(graph) + {+0.0, +0.0, r, b} = Graph.bounds(graph) assert r > 157 && r < 158 assert b > 23 && b < 24 end diff --git a/test/scenic/component/input/dropdown_test.exs b/test/scenic/component/input/dropdown_test.exs index a80225d5..4086f60b 100644 --- a/test/scenic/component/input/dropdown_test.exs +++ b/test/scenic/component/input/dropdown_test.exs @@ -199,7 +199,7 @@ defmodule Scenic.Component.Input.DropdownTest do Graph.build() |> Scenic.Components.dropdown({[{"Option One", 1}, {"Option Two", 2}], 2}, id: :dd) - {0.0, 0.0, r, b} = Graph.bounds(graph) + {+0.0, +0.0, r, b} = Graph.bounds(graph) assert r > 157 && r < 158 assert b > 38 && b < 39 end diff --git a/test/scenic/component/input/radio_button_test.exs b/test/scenic/component/input/radio_button_test.exs index 8fc5993f..db6b679a 100644 --- a/test/scenic/component/input/radio_button_test.exs +++ b/test/scenic/component/input/radio_button_test.exs @@ -106,7 +106,7 @@ defmodule Scenic.Component.Input.RadioButtonTest do Scenic.Graph.build() |> RadioButton.add_to_graph({"Radio Button", :rb, false}, id: :btn) - {0.0, 0.0, r, b} = Scenic.Graph.bounds(graph) + {+0.0, +0.0, r, b} = Scenic.Graph.bounds(graph) assert r > 140 && r < 141 assert b > 23 && b < 24 end diff --git a/test/scenic/component/input/radio_group_test.exs b/test/scenic/component/input/radio_group_test.exs index 8f8e40c6..ce31ea50 100644 --- a/test/scenic/component/input/radio_group_test.exs +++ b/test/scenic/component/input/radio_group_test.exs @@ -221,7 +221,7 @@ defmodule Scenic.Component.Input.RadioGroupTest do id: :rg ) - {0.0, 0.0, r, 72.0} = Scenic.Graph.bounds(graph) + {+0.0, +0.0, r, 72.0} = Scenic.Graph.bounds(graph) assert r > 94 && r < 95 end end diff --git a/test/scenic/component/input/slider_list_test.exs b/test/scenic/component/input/slider_list_test.exs index 0864bccd..d0cd4a52 100644 --- a/test/scenic/component/input/slider_list_test.exs +++ b/test/scenic/component/input/slider_list_test.exs @@ -159,7 +159,7 @@ defmodule Scenic.Component.Input.SliderListTest do Scenic.Graph.build() |> Scenic.Components.slider({[:a, :b, :c, :d, :e], :b}, id: :sl) - {0.0, 0.0, 300.0, 18.0} = Scenic.Graph.bounds(graph) + {+0.0, +0.0, 300.0, 18.0} = Scenic.Graph.bounds(graph) end test "bounds works with overrides" do @@ -167,6 +167,6 @@ defmodule Scenic.Component.Input.SliderListTest do Graph.build() |> Scenic.Components.slider({[:a, :b, :c, :d, :e], :b}, id: :sl, width: 400) - assert Graph.bounds(graph) == {0.0, 0.0, 400.0, 18.0} + assert Graph.bounds(graph) == {+0.0, +0.0, 400.0, 18.0} end end diff --git a/test/scenic/component/input/slider_numeric_test.exs b/test/scenic/component/input/slider_numeric_test.exs index 31795947..51b52263 100644 --- a/test/scenic/component/input/slider_numeric_test.exs +++ b/test/scenic/component/input/slider_numeric_test.exs @@ -166,7 +166,7 @@ defmodule Scenic.Component.Input.SliderNumericTest do Scenic.Graph.build() |> Scenic.Components.slider({{0, 100}, 20}, id: :sn) - {0.0, 0.0, 300.0, 18.0} = Scenic.Graph.bounds(graph) + {+0.0, +0.0, 300.0, 18.0} = Scenic.Graph.bounds(graph) end test "bounds works with overrides" do @@ -174,6 +174,6 @@ defmodule Scenic.Component.Input.SliderNumericTest do Graph.build() |> Scenic.Components.slider({{0, 100}, 20}, id: :sn, width: 400) - assert Graph.bounds(graph) == {0.0, 0.0, 400.0, 18.0} + assert Graph.bounds(graph) == {+0.0, +0.0, 400.0, 18.0} end end diff --git a/test/scenic/component/input/text_field_test.exs b/test/scenic/component/input/text_field_test.exs index 4a62f289..850a9831 100644 --- a/test/scenic/component/input/text_field_test.exs +++ b/test/scenic/component/input/text_field_test.exs @@ -339,7 +339,7 @@ defmodule Scenic.Component.Input.TextFieldTest do Graph.build() |> Scenic.Components.text_field("Test Field") - {0.0, 0.0, 288.0, 30.0} = Graph.bounds(graph) + {+0.0, +0.0, 288.0, 30.0} = Graph.bounds(graph) end test "bounds works with overrides" do @@ -347,6 +347,6 @@ defmodule Scenic.Component.Input.TextFieldTest do Graph.build() |> Scenic.Components.text_field("Test Field", width: 300, height: 40) - {0.0, 0.0, 300.0, 40.0} = Graph.bounds(graph) + {+0.0, +0.0, 300.0, 40.0} = Graph.bounds(graph) end end diff --git a/test/scenic/component/input/toggle_test.exs b/test/scenic/component/input/toggle_test.exs index 74ab73b8..f213c337 100644 --- a/test/scenic/component/input/toggle_test.exs +++ b/test/scenic/component/input/toggle_test.exs @@ -111,6 +111,6 @@ defmodule Scenic.Component.Input.ToggleTest do Graph.build() |> Scenic.Components.toggle(true) - {0.0, 0.0, 40.0, 24.0} = Graph.bounds(graph) + {+0.0, +0.0, 40.0, 24.0} = Graph.bounds(graph) end end diff --git a/test/scenic/graph/bounds_test.exs b/test/scenic/graph/bounds_test.exs index 3051e9ac..73eae8c4 100644 --- a/test/scenic/graph/bounds_test.exs +++ b/test/scenic/graph/bounds_test.exs @@ -9,8 +9,6 @@ defmodule Scenic.Graph.BoundsTest do alias Scenic.Graph - # import IEx - import Scenic.Primitives defmodule ComponentBounds do @@ -28,7 +26,7 @@ defmodule Scenic.Graph.BoundsTest do test "finds the natural bounds of an arc" do graph = Graph.build() |> arc({100, 1.2}) - {l, 0.0, 100.0, b} = Graph.bounds(graph) + {l, +0.0, 100.0, b} = Graph.bounds(graph) assert l > 36 && l < 37 assert b > 93 && b < 94 end @@ -150,7 +148,7 @@ defmodule Scenic.Graph.BoundsTest do test "finds the natural bounds of a sector" do graph = Graph.build() |> sector({100, 1.2}) - {0.0, 0.0, 100.0, b} = Graph.bounds(graph) + {+0.0, +0.0, 100.0, b} = Graph.bounds(graph) assert b > 93 && b < 94 end @@ -183,7 +181,7 @@ defmodule Scenic.Graph.BoundsTest do ) |> text("This is a test") - {0.0, 0.0, w, h} = Graph.bounds(graph) + {+0.0, +0.0, w, h} = Graph.bounds(graph) assert w > 168 && w < 169 assert h > 26 && h < 27 end @@ -199,7 +197,7 @@ defmodule Scenic.Graph.BoundsTest do ) |> text("This is a test\nMulti line") - {0.0, 0.0, w, h} = Graph.bounds(graph) + {+0.0, +0.0, w, h} = Graph.bounds(graph) assert w > 168 && w < 169 assert h > 58 && h < 59 diff --git a/test/scenic/graph/compiler_test.exs b/test/scenic/graph/compiler_test.exs index 93045f65..5c943696 100644 --- a/test/scenic/graph/compiler_test.exs +++ b/test/scenic/graph/compiler_test.exs @@ -295,12 +295,12 @@ defmodule Scenic.Graph.CompilerTest do assert [ {:fill_color, {:color_rgba, {255, 255, 0, 255}}}, :push_state, - {:transform, {7.0, 0.0, 0.0, 8.0, -20.0, -50.0}}, + {:transform, {7.0, +0.0, +0.0, 8.0, -20.0, -50.0}}, {:stroke_width, 3}, {:stroke_color, {:color_rgba, {128, 0, 128, 255}}}, {:draw_rect, {10, 20, :fill_stroke}}, :pop_push_state, - {:transform, {7.0, 0.0, 0.0, 8.0, -50.0, -50.0}}, + {:transform, {7.0, +0.0, +0.0, 8.0, -50.0, -50.0}}, {:stroke_width, 3}, {:stroke_color, {:color_rgba, {128, 0, 128, 255}}}, {:draw_circle, {10, :fill_stroke}},