Skip to content

Commit

Permalink
fix(shape): Update kittik-cursor to 2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaiklor committed Jan 18, 2016
1 parent 180456f commit 65aaf05
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/simple.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

const Rectangle = require('../lib/Rectangle').default;
const cursor = require('kittik-cursor').Cursor.create().resetTTY();
const cursor = require('kittik-cursor').default.create().resetTTY();

Rectangle.create({text: 'Text here!', x: 'center', width: 20, background: 'green', foreground: 'black'}).render(cursor);
Rectangle.create({x: 'center', y: 'middle', width: '50%', height: '20%', background: 'dark_blue'}).render(cursor);
Expand Down
20 changes: 10 additions & 10 deletions src/Rectangle.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import Shape from 'kittik-shape-basic';
*/
export default class Rectangle extends Shape {
render(cursor) {
let text = this.getText();
let width = this.getWidth();
let height = this.getHeight();
let x1 = this.getX();
let y1 = this.getY();
let x2 = x1 + width;
let y2 = y1 + height;
let background = this.getBackground();
let foreground = this.getForeground();
let filler = ' '.repeat(width);
const text = this.getText();
const width = this.getWidth();
const height = this.getHeight();
const x1 = this.getX();
const y1 = this.getY();
const x2 = x1 + width;
const y2 = y1 + height;
const background = this.getBackground();
const foreground = this.getForeground();
const filler = ' '.repeat(width);

if (typeof background !== 'undefined') cursor.background(background);
if (typeof foreground !== 'undefined') cursor.foreground(foreground);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/Rectangle.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assert } from 'chai';
import sinon from 'sinon';
import Rectangle from '../../src/Rectangle';
import { Cursor } from 'kittik-cursor';
import Cursor from 'kittik-cursor';

describe('Shape::Rectangle', () => {
it('Should properly render with default options', () => {
Expand Down

0 comments on commit 65aaf05

Please sign in to comment.