git.iko.soy/typeable/elm-ui
on master help sign in
visibility tests should be in viewport when tested
commit43f03783bbbe4471e72656e9511f5f3bd15da19f authorMatthew Griffith <mdg.griffith@gmail.com> dateWed 19 Sep 2018, 09:30 (8 years ago) parenta15c655
1 file changed+9−5
tests/Tests/Nearby.elm+9−5
tests/Tests/Nearby.elm+9−5
@@ -403,7 +403,12 @@ view =
403403 in
404404 column
405405 [ centerX, label "Nearby Elements", spacing 100 ]
406− [ master
406+ [ layeredVisibility
407+ , overlappingChildren
408+
409+ -- Note: visibility checks like the above
410+ -- need to be at the top so they're in the viewport
411+ , master
407412 , masterParagraph
408413 , nearby above "above" box
409414 , nearby below "below" box
@@ -411,14 +416,13 @@ view =
411416 , nearby onRight "onRight" box
412417 , nearby onLeft "onLeft" box
413418 , nearby behindContent "behindContent" transparentBox
414− , layeredVisibility
415− , overlappingChildren
416419 ]
417420
418421
419422layeredVisibility =
420423 el
421− [ inFront (justBox 40 red [ isVisible ])
424+ [ centerX
425+ , inFront (justBox 40 red [ isVisible ])
422426 ]
423427 (el [ inFront (justBox 30 green []) ]
424428 (justBox 50 blue [])
@@ -426,7 +430,7 @@ layeredVisibility =
426430
427431
428432overlappingChildren =
429− row []
433+ row [ centerX ]
430434 [ el [ inFront (justBox 40 green []) ]
431435 (justBox 40 darkGrey [])
432436 , el [ onLeft (littleBox "overlapping" [ isVisible, Background.color red ]) ]