2015-03-20 14:21:50 -06:00
|
|
|
// Copyright 2015 Zack Guo <gizak@icloud.com>. All rights reserved.
|
|
|
|
// Use of this source code is governed by a MIT license that can
|
|
|
|
// be found in the LICENSE file.
|
|
|
|
|
2015-02-03 07:07:31 -07:00
|
|
|
package termui
|
|
|
|
|
2015-03-24 15:16:43 -06:00
|
|
|
// Point stands for a single cell in terminal.
|
2015-02-03 07:07:31 -07:00
|
|
|
type Point struct {
|
2015-03-03 11:28:09 -07:00
|
|
|
Ch rune
|
|
|
|
Bg Attribute
|
|
|
|
Fg Attribute
|
|
|
|
X int
|
|
|
|
Y int
|
|
|
|
}
|
|
|
|
|
|
|
|
func newPoint(c rune, x, y int) (p Point) {
|
|
|
|
p.Ch = c
|
|
|
|
p.X = x
|
|
|
|
p.Y = y
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func newPointWithAttrs(c rune, x, y int, fg, bg Attribute) Point {
|
|
|
|
p := newPoint(c, x, y)
|
|
|
|
p.Bg = bg
|
|
|
|
p.Fg = fg
|
|
|
|
return p
|
2015-02-03 07:07:31 -07:00
|
|
|
}
|