-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from unisonweb/vendor-splitpane
Fix split resize in release builds by vendoring SplitPane
- Loading branch information
Showing
7 changed files
with
824 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
module SplitPane.Bound exposing (Bound, Bounded, getValue, putValue, updateValue, putBound, createBound, createBounded) | ||
|
||
{-| This module defines a value that is between two other values. | ||
@docs Bound, Bounded, getValue, putValue, updateValue, putBound, createBound, createBounded | ||
-} | ||
|
||
|
||
{-| Type that defines a border of values | ||
-} | ||
type alias Bound a = | ||
( a, a ) | ||
|
||
|
||
{-| Type that defines a value that is within a border of two other values | ||
-} | ||
type alias Bounded a = | ||
( a, Bound a ) | ||
|
||
|
||
{-| Create a new bounded value. | ||
-} | ||
getValue : Bounded comparable -> comparable | ||
getValue value = | ||
Tuple.first value | ||
|
||
|
||
{-| Create a new bounded value. | ||
-} | ||
createBounded : comparable -> Bound comparable -> Bounded comparable | ||
createBounded value bound = | ||
putValue ( value, bound ) value | ||
|
||
|
||
{-| Change the value that is bounded. | ||
-} | ||
putValue : Bounded comparable -> comparable -> Bounded comparable | ||
putValue ( _, bound ) value = | ||
( boundTo bound value, bound ) | ||
|
||
|
||
{-| Update the value that is bounded. | ||
-} | ||
updateValue : (comparable -> comparable) -> Bounded comparable -> Bounded comparable | ||
updateValue f ( value, bound ) = | ||
( boundTo bound (f value), bound ) | ||
|
||
|
||
{-| Change the bound of the bounded value. | ||
-} | ||
putBound : Bounded comparable -> Bound comparable -> Bounded comparable | ||
putBound ( value, _ ) bound = | ||
( value, bound ) | ||
|
||
|
||
{-| Create a new bound that can be used to restrict a value. | ||
-} | ||
createBound : comparable -> comparable -> Bound comparable | ||
createBound a b = | ||
( min a b, max a b ) | ||
|
||
|
||
boundTo : Bound comparable -> comparable -> comparable | ||
boundTo ( a, b ) = | ||
min b << max a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# SplitPane | ||
|
||
To support Elm 0.19.1 (and crucially to support optimize mode), this is | ||
vendored version of [quentin/elm-split-pane](https://github.com/quentin/elm-split-pane) which builds on a series of forks: | ||
|
||
|
||
* The original: [doodledood/elm-split-pane](https://github.com/doodledood/elm-split-pane) | ||
* 0.19.0 support: [whale9490/elm-split-pane](https://github.com/whale9490/elm-split-pane) | ||
* 0.19.1 support: [quentin/elm-split-pane](https://github.com/quentin/elm-split-pane) |
Oops, something went wrong.