File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"use strict" ;
22
3- const Cursor = require ( 'kittik-cursor' ) . default ;
4- const Shape = require ( '../lib/Shape' ) . default ;
3+ const Cursor = require ( 'kittik-cursor' ) ;
4+ const Shape = require ( '../lib/Shape' ) ;
55const cursor = new Cursor ( ) . resetTTY ( ) ;
66
77// Create class that extends from Shape and implement render() method
88class Rectangle extends Shape {
99 render ( cursor ) {
10- let text = this . getText ( ) ;
11- let width = this . getWidth ( ) ;
12- let height = this . getHeight ( ) ;
13- let x1 = this . getX ( ) ;
14- let y1 = this . getY ( ) ;
15- let x2 = x1 + width ;
16- let y2 = y1 + height ;
17- let background = this . getBackground ( ) ;
18- let foreground = this . getForeground ( ) ;
19- let filler = ' ' . repeat ( width ) ;
10+ const text = this . getText ( ) ;
11+ const width = this . getWidth ( ) ;
12+ const height = this . getHeight ( ) ;
13+ const x1 = this . getX ( ) ;
14+ const y1 = this . getY ( ) ;
15+ const x2 = x1 + width ;
16+ const y2 = y1 + height ;
17+ const background = this . getBackground ( ) ;
18+ const foreground = this . getForeground ( ) ;
19+ const filler = ' ' . repeat ( width ) ;
2020
2121 if ( typeof background !== 'undefined' ) cursor . background ( background ) ;
2222 if ( typeof foreground !== 'undefined' ) cursor . foreground ( foreground ) ;
Original file line number Diff line number Diff line change 11"use strict" ;
22
3- const Cursor = require ( 'kittik-cursor' ) . default ;
4- const Shape = require ( '../lib/Shape' ) . default ;
3+ const Cursor = require ( 'kittik-cursor' ) ;
4+ const Shape = require ( '../lib/Shape' ) ;
55const cursor = new Cursor ( ) . resetTTY ( ) ;
66
77// Create class that extends from Shape and implement render() method
You can’t perform that action at this time.
0 commit comments