mirror of
https://github.com/jroimartin/gocui.git
synced 2025-04-30 13:48:54 +08:00
Added some extra error checks to solve the first error
This commit is contained in:
parent
49ef258c94
commit
1163a688bc
2
gui.go
2
gui.go
@ -572,7 +572,7 @@ func corner(v *View, directions byte) rune {
|
|||||||
// drawFrameCorners draws the corners of the view.
|
// drawFrameCorners draws the corners of the view.
|
||||||
func (g *Gui) drawFrameCorners(v *View, fgColor, bgColor Attribute) error {
|
func (g *Gui) drawFrameCorners(v *View, fgColor, bgColor Attribute) error {
|
||||||
if v.y0 == v.y1 {
|
if v.y0 == v.y1 {
|
||||||
if !g.SupportOverlaps {
|
if !g.SupportOverlaps && v.x0 >= 0 && v.x1 >= 0 && v.y0 >= 0 && v.x0 < g.maxX && v.x1 < g.maxX && v.y0 < g.maxY {
|
||||||
if err := g.SetRune(v.x0, v.y0, '╶', fgColor, bgColor); err != nil {
|
if err := g.SetRune(v.x0, v.y0, '╶', fgColor, bgColor); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user