File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const Cursor = require('kittik-cursor').Cursor;
44const Shape = require ( '../lib/Basic' ) . default ;
55const cursor = new Cursor ( ) . resetTTY ( ) ;
66
7+ // Create class that extends from Shape and implement render() method
78class Text extends Shape {
89 render ( cursor ) {
910 const text = this . getText ( ) ;
Original file line number Diff line number Diff line change @@ -194,6 +194,35 @@ export default class Shape {
194194 return this ;
195195 }
196196
197+ /**
198+ * Get align property from this shape.
199+ *
200+ * @returns {String }
201+ */
202+ getAlign ( ) {
203+ return this . get ( 'align' ) ;
204+ }
205+
206+ /**
207+ * Set align to this shape.
208+ *
209+ * @param {String } align
210+ * @returns {Shape }
211+ */
212+ setAlign ( align ) {
213+ this . set ( 'align' , align ) ;
214+ return this ;
215+ }
216+
217+ /**
218+ * Check if this shape must be aligned.
219+ *
220+ * @returns {Boolean }
221+ */
222+ isAligned ( ) {
223+ return ! ! this . get ( 'align' ) ;
224+ }
225+
197226 /**
198227 * Get animation options from this shape.
199228 *
You can’t perform that action at this time.
0 commit comments