Skip to content

Commit

Permalink
Merge pull request #355 from mum4k/release-v0.18.0
Browse files Browse the repository at this point in the history
Release Termdash v0.18.0.

## v0.18.0 - 08-Feb-2023

### Added

- The `gauge` widget now supports drawing of a vertical threshold bar.
- The `TextInput` widget now supports an OnChange handler that allows user code
  to be notified when the content of the text input changes.

### Changed

- Bump github.com/gdamore/tcell/v2 from 2.5.1 to 2.5.4.
- Bump github.com/mattn/go-runewidth from 0.0.13 to 0.0.14.
- Bump github.com/gdamore/tcell/v2 from 2.5.1 to 2.5.3.
- Bump github.com/gdamore/tcell/v2 from 2.5.1 to 2.5.2
- Change the Go version in `go.mod` to 1.20.
- Executed `go mod tidy`.
- CI now executes tests with Golang v1.20 only.

### Removed

- Removed the `Sourcegraph` badge from the main page.

### Fixed

- Formatted all Go files with `gofmt` from Golang v1.20.
- Fixed line coverage reporting.
  • Loading branch information
mum4k committed Feb 8, 2023
2 parents 9954a05 + 2446873 commit e7f235a
Show file tree
Hide file tree
Showing 25 changed files with 737 additions and 342 deletions.
34 changes: 15 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
language: go
go:
- 1.16.x
- 1.17.x
- stable
- 1.20.x
- stable
before_install:
- go install golang.org/x/tools/cmd/cover@latest
- go install github.com/mattn/goveralls@latest
- go install golang.org/x/lint/golint@latest
- go install golang.org/x/tools/cmd/cover@latest
- go install github.com/mattn/goveralls@latest
- go install golang.org/x/lint/golint@latest
script:
- go get -t ./...
# Temporarily set -mod=mod to allow modification of go.mod and go.sum.
# This seems to be caused by a sum missing in the tcell dependency and
# should be removed when no longer needed.
- go test -v -covermode=count -coverprofile=coverage.out -mod=mod ./...
- CGO_ENABLED=1 go test -mod=mod -race ./...
- go vet ./...
- diff -u <(echo -n) <(gofmt -d -s .)
- diff -u <(echo -n) <(./private/scripts/autogen_licences.sh .)
- diff -u <(echo -n) <(golint ./...)
- $GOPATH/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN
- go get -t ./...
- go test -v -covermode=count -coverprofile=coverage.out ./...
- CGO_ENABLED=1 go test -race ./...
- go vet ./...
- diff -u <(echo -n) <(gofmt -d -s .)
- diff -u <(echo -n) <(./private/scripts/autogen_licences.sh .)
- diff -u <(echo -n) <(golint ./...)
- $GOPATH/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN
env:
global:
- CGO_ENABLED=0
- secure: VOOh/w2YNAn+psiWYjIOQ5ZhhMb6Wz7zzmhIlj0dc5mGQztFAX5TuNWOU5JokvOigFy18JhPeDJRmp661xqM4gy1Znx1odSXES3YdCwt42pmpjYIkI9lI09xTRH6WYIRmYfCHe4J3A9/CWLeDRaAU1e+YqmNyraaGzE82ouUPH/I4A9gur4j4j6t1X/t0iovyd/4qNDsetUPevQsJS224Pv6Xhg3LGnSAXMPM+tu0t3UeEfRu/l9OgP6/bnet9BUx0BryFCVJp6fAtq7x61+WRIJesugrhHVgl/dz8CgFsVjRkqWQSNnZvt07dHNOX0mZj2U22OAkH+9ZN93wScs3bDZFXozrta7eOWhrJLcJTMrAxdHYMNKmoXqQQ0TGFV/L9blOtT8uj9US3wxeD11s4TyZePWIC5hnpUsNFoGPsBB45uwW2TSwvTTEL9bxWWzjYzSkLG5P6Kk4/JkeMh3OMFCM/LutX8QDch1n/s0CfXdy7qgh5G4I9ZhGTU+huJlumeuM4U+my0EPnA3uclJ97cw0n6K7MKwKCTTA8La2ifATunKC/U4Hjo1rf9DxofIrRIvwV5zEUIn1r6ut5fO+o+MWDupkvsMqIA7QJyCLhRp+pAlPWGDZLdrFEicN/kpULH4IGUIPn532gXzEOAG+Aq0WYDVPXGLSifSyxafiDk=
- CGO_ENABLED=0
- secure: FEFt9o7MvSvK2lnXJTydml/DCmNqPKIc+YJjPlKhfeGGJyruFvP55qkB0rHN7wb2r4L44qMqtM12c41YzA0sFhXXNowhCB0wd7mfyEt3cCLr4akqRedxOpz+qFBGv2oCBObP6e6irtsN0071KtDz9wsITchme3gf0A8l9PhjPeEu9UVbmN8lipouvQFqmdxqLNyxJ+ykbACkSTwIx2rkvU79aOPDoSnDO56Wqaq7V75CmZ13EtHupgmJIz2GECyIL6Ll6824AQiK1O5XXpnc8973Vw1s6kZB5Tyzvb2KaW5U9KhovgX1mTvnj1XJ//SQvh9yMjC5L51DLNbLSshVo7L4CiJZkq8QQLFILPOMaC1emrmhXxwizjbTmNOo96t2MYk2WASq636Uoez0ZkkZPjuwuKoexFi7r04vHEOjnF2N9liN+M8gwvJ5N/MakbS3ZPbZ+57w4xgwuxJRSUYQoT1VSU8E2rc+DQYa4HzY4wrcrJQG7HBjd4KBHnmHjEDAmawBb6iEI9d5d40j0LThxAOweh05YoWVmnTzMScuO27V5embStXab31jUrD4Qnj5/lliklGdYD5aWLKRZhSeg5mLikUITbhriABuUxMaR1FuQW4r1nSg3n8XA6MbwdvngO2DJyzp5iUQX3yfnUgrGzfp9okrA4CdxUHrY/jj8cw=
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.18.0] - 08-Feb-2023

### Added

- The `gauge` widget now supports drawing of a vertical threshold bar.
- The `TextInput` widget now supports an OnChange handler that allows user code
to be notified when the content of the text input changes.

### Changed

- Bump github.com/gdamore/tcell/v2 from 2.5.1 to 2.5.4.
- Bump github.com/mattn/go-runewidth from 0.0.13 to 0.0.14.
- Bump github.com/gdamore/tcell/v2 from 2.5.1 to 2.5.3.
- Bump github.com/gdamore/tcell/v2 from 2.5.1 to 2.5.2
- Change the Go version in `go.mod` to 1.20.
- Executed `go mod tidy`.
- CI now executes tests with Golang v1.20 only.

### Removed

- Removed the `Sourcegraph` badge from the main page.

### Fixed

- Formatted all Go files with `gofmt` from Golang v1.20.
- Fixed line coverage reporting.

## [0.17.0] - 07-Jul-2022

### Added
Expand Down Expand Up @@ -490,6 +517,7 @@ identifiers shouldn't be used externally.
- The Text widget.

[unreleased]: https://github.com/mum4k/termdash/compare/v0.17.0...devel
[0.18.0]: https://github.com/mum4k/termdash/compare/v0.17.0...v0.18.0
[0.17.0]: https://github.com/mum4k/termdash/compare/v0.16.1...v0.17.0
[0.16.1]: https://github.com/mum4k/termdash/compare/v0.16.0...v0.16.1
[0.16.0]: https://github.com/mum4k/termdash/compare/v0.15.0...v0.16.0
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[![Doc Status](https://godoc.org/github.com/mum4k/termdash?status.png)](https://godoc.org/github.com/mum4k/termdash)
[![Build Status](https://travis-ci.com/mum4k/termdash.svg?branch=master)](https://travis-ci.com/mum4k/termdash)
[![Sourcegraph](https://sourcegraph.com/github.com/mum4k/termdash/-/badge.svg)](https://sourcegraph.com/github.com/mum4k/termdash?badge)
[![Coverage Status](https://coveralls.io/repos/github/mum4k/termdash/badge.svg?branch=master)](https://coveralls.io/github/mum4k/termdash?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/mum4k/termdash)](https://goreportcard.com/report/github.com/mum4k/termdash)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/mum4k/termdash/blob/master/LICENSE)
Expand Down
35 changes: 23 additions & 12 deletions container/grid/grid.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ func (b *Builder) Build() ([]container.Option, error) {

// validate recursively validates the elements that were added to the builder.
// Validates the following per each level of Rows or Columns.:
// The subElements are either exactly one Widget or any number of Rows and
// Columns.
// Each individual width or height is in the range 0 < v < 100.
// The sum of all widths is <= 100.
// The sum of all heights is <= 100.
//
// The subElements are either exactly one Widget or any number of Rows and
// Columns.
// Each individual width or height is in the range 0 < v < 100.
// The sum of all widths is <= 100.
// The sum of all heights is <= 100.
//
// Argument fixedSizeParent indicates if any of the parent elements uses fixed
// size splitType.
func validate(elems []Element, fixedSizeParent bool) error {
Expand Down Expand Up @@ -182,17 +184,26 @@ func build(elems []Element, parentHeightPerc, parentWidthPerc int) []container.O
// E.g. multiple rows would specify that they want the outer split percentage
// of 25% each, but we are representing them in a tree of containers so the
// inner splits vary:
// ╭─────────╮
//
// ╭─────────╮
//
// 25% │ 25% │
// │╭───────╮│ ---
//
// │╭───────╮│ ---
//
// 25% ││ 33% ││
// ││╭─────╮││
//
// ││╭─────╮││
//
// 25% │││ 50% │││
// ││├─────┤││ 75%
//
// ││├─────┤││ 75%
//
// 25% │││ 50% │││
// ││╰─────╯││
// │╰───────╯│
// ╰─────────╯ ---
//
// ││╰─────╯││
// │╰───────╯│
// ╰─────────╯ ---
//
// Argument outerPerc is the user specified percentage for the split, i.e. the
// 25% in the example above.
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
module github.com/mum4k/termdash

go 1.17
go 1.20

require (
github.com/gdamore/tcell/v2 v2.5.1
github.com/gdamore/tcell/v2 v2.5.4
github.com/kylelemons/godebug v1.1.0
github.com/mattn/go-runewidth v0.0.13
github.com/mattn/go-runewidth v0.0.14
github.com/nsf/termbox-go v1.1.1
)

require (
github.com/gdamore/encoding v1.0.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/text v0.5.0 // indirect
)
34 changes: 25 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,27 +1,43 @@
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
github.com/gdamore/tcell/v2 v2.5.1 h1:zc3LPdpK184lBW7syF2a5C6MV827KmErk9jGVnmsl/I=
github.com/gdamore/tcell/v2 v2.5.1/go.mod h1:wSkrPaXoiIWZqW/g7Px4xc79di6FTcpB8tvaKJ6uGBo=
github.com/gdamore/tcell/v2 v2.5.4 h1:TGU4tSjD3sCL788vFNeJnTdzpNKIw1H5dgLnJRQVv/k=
github.com/gdamore/tcell/v2 v2.5.4/go.mod h1:dZgRy5v4iMobMEcWNYBtREnDZAT9DYmfqIkrgEMxLyw=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/nsf/termbox-go v1.1.1 h1:nksUPLCb73Q++DwbYUBEglYBRPZyoXJdrj5L+TkjyZY=
github.com/nsf/termbox-go v1.1.1/go.mod h1:T0cTdVuOwf7pHQNtfhnEbzHbcNyCEcVU4YPpouCbVxo=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220318055525-2edf467146b5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e h1:CsOuNlbOuf0mzxJIefr6Q4uAUetRUwZE4qt7VfzP+xo=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM=
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
14 changes: 7 additions & 7 deletions private/canvas/braille/braille.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ right and down.
Each cell:
X→ 0 1 Y
┌───┐ ↓
│● ●│ 0
│● ●│ 1
│● ●│ 2
│● ●│ 3
└───┘
X→ 0 1 Y
┌───┐ ↓
│● ●│ 0
│● ●│ 1
│● ●│ 2
│● ●│ 3
└───┘
When using the braille canvas, the coordinates address the sub-cell points
rather then cells themselves. However all points in the cell still share the
Expand Down
11 changes: 6 additions & 5 deletions private/draw/vertical_text.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ func VerticalTextOverrunMode(om OverrunMode) VerticalTextOption {

// VerticalText prints the provided text on the canvas starting at the provided point.
// The text is printed in a vertical orientation, i.e:
// H
// e
// l
// l
// o
//
// H
// e
// l
// l
// o
func VerticalText(c *canvas.Canvas, text string, start image.Point, opts ...VerticalTextOption) error {
ar := c.Area()
if !start.In(ar) {
Expand Down
17 changes: 10 additions & 7 deletions private/numbers/trig/trig.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ func (ar *angleRange) contains(angle int) bool {
// normalizeRange normalizes the start and end angles in degrees into ranges of
// angles. Useful for cases where the 0/360 point falls within the range.
// E.g:
// 0,25 => angleRange{0, 26}
// 0,360 => angleRange{0, 361}
// 359,20 => angleRange{359, 361}, angleRange{0, 21}
//
// 0,25 => angleRange{0, 26}
// 0,360 => angleRange{0, 361}
// 359,20 => angleRange{359, 361}, angleRange{0, 21}
func normalizeRange(start, end int) ([]*angleRange, error) {
if start < MinAngle || start > MaxAngle {
return nil, fmt.Errorf("invalid start angle:%d, must be in range %d <= start <= %d", start, MinAngle, MaxAngle)
Expand Down Expand Up @@ -159,8 +160,9 @@ func normalizeRange(start, end int) ([]*angleRange, error) {

// RangeSize returns the size of the degree range.
// E.g:
// 0,25 => 25
// 359,1 => 2
//
// 0,25 => 25
// 359,1 => 2
func RangeSize(start, end int) (int, error) {
ranges, err := normalizeRange(start, end)
if err != nil {
Expand All @@ -174,8 +176,9 @@ func RangeSize(start, end int) (int, error) {

// RangeMid returns an angle that lies in the middle between start and end.
// E.g:
// 0,10 => 5
// 350,10 => 0
//
// 0,10 => 5
// 350,10 => 0
func RangeMid(start, end int) (int, error) {
ranges, err := normalizeRange(start, end)
if err != nil {
Expand Down
26 changes: 13 additions & 13 deletions private/segdisp/dotseg/dotseg.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ display dot characters.
The following outlines segments in the display and their names.
---------------
| |
| |
| |
| o D1 |
| |
| |
| |
| o D2 |
| |
| |
| o D3 |
---------------
---------------
| |
| |
| |
| o D1 |
| |
| |
| |
| o D2 |
| |
| |
| o D3 |
---------------
*/
package dotseg

Expand Down
17 changes: 9 additions & 8 deletions private/segdisp/segment/segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,15 @@ func SkipSlopesLTE(v int) Option {
// This only has a visible effect when the horizontal segment has height of two
// or the vertical segment has width of two.
// Without this option segments with height / width of two look like this:
// - |
// --- ||
// |
//
// With this option:
// --- |
// - ||
// |
// x - |
// x --- ||
// x |
// x
// x With this option:
// x
// x --- |
// x - ||
// x |
func ReverseSlopes() Option {
return option(func(opts *options) {
opts.reverseSlopes = true
Expand Down
30 changes: 15 additions & 15 deletions private/segdisp/sixteen/sixteen.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ display ASCII characters.
The following outlines segments in the display and their names.
A1 A2
------- -------
| \ | / |
| \ | / |
F | H J K | B
| \ | / |
| \ | / |
-G1---- ----G2-
| / | \ |
| / | \ |
E | N M L | C
| / | \ |
| / | \ |
------- -------
D1 D2
A1 A2
------- -------
| \ | / |
| \ | / |
F | H J K | B
| \ | / |
| \ | / |
-G1---- ----G2-
| / | \ |
| / | \ |
E | N M L | C
| / | \ |
| / | \ |
------- -------
D1 D2
*/
package sixteen

Expand Down
Loading

0 comments on commit e7f235a

Please sign in to comment.