devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
17 lines (16 loc) • 842 B
JavaScript
import { LayoutPoint } from '../../../../../layout/layout-point';
import { Point } from '@devexpress/utils/lib/geometry/point';
import { BaseFormatter } from '../../base-formatter';
import { DivElement } from '../../elements';
export class CCF_Point extends BaseFormatter {
isHandleObject(obj) {
return obj instanceof Point;
}
getShortDescription(_config) {
if (this.curr instanceof LayoutPoint)
return new DivElement().setText(`${this.curr.pageIndex}: [${this.toFixed(this.curr.x)}, ${this.toFixed(this.curr.y)}]`).setColor(BaseFormatter.valueColor);
else
return new DivElement().setText(`[${this.toFixed(this.curr.x)}, ${this.toFixed(this.curr.y)}]`).setColor(BaseFormatter.valueColor);
}
}
CCF_Point._foo = BaseFormatter.addToFormattersList(new CCF_Point());