// RelMsg returns a range-relative version of messages defined by the gruid
// package. Currently, it only affects mouse messages, which are given
// positions relative to the range.
RelMsg returns a range-relative version of messages defined by the gruid
package. Currently, it only affects mouse messages, which are given
positions relative to the range.
// RelMsg returns a range - relative version of messages defined by the gruid // package . Currently it only affects mouse messages which are given // positions relative to the range .
func (rg Range) RelMsg(msg Msg) Msg {
	if msg, ok := msg.(MsgMouse); ok {
		msg.P = msg.P.Sub(rg.Min)
		return msg
	}
	return msg
}
func ( rg Range ) RelMsg ( msg Msg ) Msg { if msg , ok := msg . ( MsgMouse ) ; ok { msg . P = msg . P . Sub ( rg . Min ) return msg } return msg }
RelMsg returns a range-relative version of messages defined by the gruid
package.
RelMsg returns a range - relative version of messages defined by the gruid package .