Skip to content

Commit 1480136

Browse files
committed
Merge branch 'primitve_primitive' of https://github.com/hassanshaikley/scenic into hassanshaikley-primitve_primitive
2 parents ab7d9df + 23fe789 commit 1480136

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

lib/scenic/primitive.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ defmodule Scenic.Primitive do
347347
Returns the primitive with the updated styles.
348348
"""
349349
@spec put_styles(primitive :: Primitive.t(), styles :: map) :: Primitive.t()
350-
def put_styles(primitve, styles)
350+
def put_styles(primitive, styles)
351351
def put_styles(%Primitive{} = p, nil), do: Map.delete(p, :styles)
352352
def put_styles(%Primitive{} = p, s) when s == %{}, do: Map.delete(p, :styles)
353353

@@ -454,7 +454,7 @@ defmodule Scenic.Primitive do
454454
Returns the primitive with the updated transforms.
455455
"""
456456
@spec put_transforms(primitive :: Primitive.t(), transforms :: map) :: Primitive.t()
457-
def put_transforms(primitve, transforms)
457+
def put_transforms(primitive, transforms)
458458
def put_transforms(%Primitive{} = p, nil), do: Map.delete(p, :transforms)
459459
def put_transforms(%Primitive{} = p, t) when t == %{}, do: Map.delete(p, :transforms)
460460

lib/scenic/view_port.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ defmodule Scenic.ViewPort do
463463
dynamic_root_pid: nil,
464464
root_config: nil,
465465
input_captures: %{},
466-
hover_primitve: nil,
466+
hover_primitive: nil,
467467
drivers: [],
468468
driver_registry: %{},
469469
supervisor: vp_supervisor,
@@ -512,7 +512,7 @@ defmodule Scenic.ViewPort do
512512
# prep state, which is mostly about resetting input
513513
state =
514514
state
515-
|> Map.put(:hover_primitve, nil)
515+
|> Map.put(:hover_primitive, nil)
516516
|> Map.put(:input_captures, %{})
517517

518518
# fetch the dynamic supervisor

lib/scenic/view_port/input.ex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,9 @@ defmodule Scenic.ViewPort.Input do
499499
# ============================================================================
500500
# regular input helper utilties
501501

502-
defp send_exit_message(%{hover_primitve: nil} = state), do: state
502+
defp send_exit_message(%{hover_primitive: nil} = state), do: state
503503

504-
defp send_exit_message(%{hover_primitve: {uid, graph_key}} = state) do
504+
defp send_exit_message(%{hover_primitive: {uid, graph_key}} = state) do
505505
Scene.cast(
506506
graph_key,
507507
{
@@ -511,13 +511,13 @@ defmodule Scenic.ViewPort.Input do
511511
}
512512
)
513513

514-
%{state | hover_primitve: nil}
514+
%{state | hover_primitive: nil}
515515
end
516516

517-
defp send_enter_message(uid, id, graph_key, %{hover_primitve: hover_primitve} = state) do
518-
# first, send the previous hover_primitve an exit message
517+
defp send_enter_message(uid, id, graph_key, %{hover_primitive: hover_primitive} = state) do
518+
# first, send the previous hover_primitive an exit message
519519
state =
520-
case hover_primitve do
520+
case hover_primitive do
521521
nil ->
522522
# no previous hover_primitive set. do not send an exit message
523523
state
@@ -531,9 +531,9 @@ defmodule Scenic.ViewPort.Input do
531531
send_exit_message(state)
532532
end
533533

534-
# send the new hover_primitve an enter message
534+
# send the new hover_primitive an enter message
535535
state =
536-
case state.hover_primitve do
536+
case state.hover_primitive do
537537
nil ->
538538
# yes. setting a new one. send it.
539539
Scene.cast(
@@ -545,7 +545,7 @@ defmodule Scenic.ViewPort.Input do
545545
}
546546
)
547547

548-
%{state | hover_primitve: {uid, graph_key}}
548+
%{state | hover_primitive: {uid, graph_key}}
549549

550550
_ ->
551551
# not setting a new one. do nothing.

test/scenic/view_port/input_test.exs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ defmodule Scenic.ViewPort.InputTest do
269269
root_graph_key: graph_key,
270270
input_captures: %{},
271271
max_depth: 10,
272-
hover_primitve: nil
272+
hover_primitive: nil
273273
}
274274
)
275275

@@ -289,7 +289,7 @@ defmodule Scenic.ViewPort.InputTest do
289289
root_graph_key: graph_key,
290290
input_captures: %{},
291291
max_depth: 10,
292-
hover_primitve: nil
292+
hover_primitive: nil
293293
}
294294
)
295295

@@ -316,7 +316,7 @@ defmodule Scenic.ViewPort.InputTest do
316316
root_graph_key: graph_key,
317317
input_captures: %{},
318318
max_depth: 10,
319-
hover_primitve: nil
319+
hover_primitive: nil
320320
}
321321
)
322322

@@ -342,7 +342,7 @@ defmodule Scenic.ViewPort.InputTest do
342342
root_graph_key: graph_key,
343343
input_captures: %{},
344344
max_depth: 10,
345-
hover_primitve: {1, graph_key}
345+
hover_primitive: {1, graph_key}
346346
}
347347
)
348348

@@ -368,7 +368,7 @@ defmodule Scenic.ViewPort.InputTest do
368368
root_graph_key: graph_key,
369369
input_captures: %{},
370370
max_depth: 10,
371-
hover_primitve: {1, graph_key}
371+
hover_primitive: {1, graph_key}
372372
}
373373
)
374374

@@ -391,7 +391,7 @@ defmodule Scenic.ViewPort.InputTest do
391391
root_graph_key: graph_key,
392392
input_captures: %{},
393393
max_depth: 10,
394-
hover_primitve: {1, graph_key}
394+
hover_primitive: {1, graph_key}
395395
}
396396
)
397397

@@ -645,7 +645,7 @@ defmodule Scenic.ViewPort.InputTest do
645645
root_graph_key: graph_key,
646646
input_captures: %{cursor_pos: context},
647647
max_depth: 10,
648-
hover_primitve: nil
648+
hover_primitive: nil
649649
}
650650
)
651651

@@ -670,7 +670,7 @@ defmodule Scenic.ViewPort.InputTest do
670670
root_graph_key: graph_key,
671671
input_captures: %{cursor_pos: context},
672672
max_depth: 10,
673-
hover_primitve: nil
673+
hover_primitive: nil
674674
}
675675
)
676676

@@ -695,7 +695,7 @@ defmodule Scenic.ViewPort.InputTest do
695695
root_graph_key: graph_key,
696696
input_captures: %{cursor_pos: context},
697697
max_depth: 10,
698-
hover_primitve: nil
698+
hover_primitive: nil
699699
}
700700
)
701701

@@ -723,7 +723,7 @@ defmodule Scenic.ViewPort.InputTest do
723723
root_graph_key: graph_key,
724724
input_captures: %{cursor_pos: context},
725725
max_depth: 10,
726-
hover_primitve: {1, graph_key1}
726+
hover_primitive: {1, graph_key1}
727727
}
728728
)
729729

0 commit comments

Comments
 (0)