Debian Codegraph @

vt/coord.go

raw symbols SCIP
1 // Copyright 2025 The TCell Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 package vt
15
16 // Separate Row and Col types are used to reduce the chance of mixing up the coordinate axes.
17 // We use zero-based coordinates (although VT hardware underneath uses one-based in escape sequences).
18 // The upper left corner of the screen is at coordinate (0, 0).
19
20 // Row indicates a row number (y position). We use zero based indices, although the VT
21 // standard mostly communicates using 1-based offsets.
22 type Row int
23
24 // Col indicates a column number (x position). We use zero based indices.
25 type Col int
26
27 // Coord indicates a coordinate. This can also be used for window sizes.
28 type Coord struct {
29 X Col // Column number, or X position.
30 Y Row // Row number, or Y position.
31 }