UNPKG

devexpress-richedit

Version:

DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.

29 lines (28 loc) 1.28 kB
import { Pair } from '@devexpress/utils/lib/class/pair'; import { Rectangle } from '@devexpress/utils/lib/geometry/rectangle'; import { BaseFormatter, StdProps } from '../../base-formatter'; import { DivElement } from '../../elements'; export class CCF_Rectangle extends BaseFormatter { isHandleObject(obj) { return obj instanceof Rectangle; } getShortDescription(_config) { return new DivElement().setText(`[${this.toFixed(this.curr.x)}, ${this.toFixed(this.curr.y)}, ${this.toFixed(this.curr.width)}, ${this.toFixed(this.curr.height)}]`); } availableFullDescription(_config) { return true; } getFullDescription(_config) { return this.stdShow(new StdProps([ new Pair("x", this.toFixed(this.curr.x)), new Pair("y", this.toFixed(this.curr.y)), new Pair("width", this.toFixed(this.curr.width)), new Pair("height", this.toFixed(this.curr.height)), new Pair("maxX", this.toFixed(this.curr.right)), new Pair("maxY", this.toFixed(this.curr.bottom)), new Pair("center", this.curr.center) ]) .showAsColumn()); } } CCF_Rectangle._foo = BaseFormatter.addToFormattersList(new CCF_Rectangle());