|
|
|
|
@ -270,14 +270,14 @@ export class CommandAdapt {
|
|
|
|
|
|
|
|
|
|
public applyPainterStyle() {
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
this.canvasEvent.applyPainterStyle()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public format() {
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
const selection = this.range.getSelectionElementList()
|
|
|
|
|
// 选区设置或设置换行处样式
|
|
|
|
|
@ -310,7 +310,7 @@ export class CommandAdapt {
|
|
|
|
|
|
|
|
|
|
public font(payload: string) {
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
const selection = this.range.getSelectionElementList()
|
|
|
|
|
if (selection?.length) {
|
|
|
|
|
@ -333,7 +333,7 @@ export class CommandAdapt {
|
|
|
|
|
const { minSize, maxSize, defaultSize } = this.options
|
|
|
|
|
if (payload < minSize || payload > maxSize) return
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
// 选区设置或设置换行处样式
|
|
|
|
|
let renderOption: IDrawOption = {}
|
|
|
|
|
@ -370,7 +370,7 @@ export class CommandAdapt {
|
|
|
|
|
|
|
|
|
|
public sizeAdd() {
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
const selection = this.range.getTextLikeSelectionElementList()
|
|
|
|
|
// 选区设置或设置换行处样式
|
|
|
|
|
@ -410,7 +410,7 @@ export class CommandAdapt {
|
|
|
|
|
|
|
|
|
|
public sizeMinus() {
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
const selection = this.range.getTextLikeSelectionElementList()
|
|
|
|
|
// 选区设置或设置换行处样式
|
|
|
|
|
@ -450,7 +450,7 @@ export class CommandAdapt {
|
|
|
|
|
|
|
|
|
|
public bold() {
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
const selection = this.range.getSelectionElementList()
|
|
|
|
|
if (selection?.length) {
|
|
|
|
|
@ -472,7 +472,7 @@ export class CommandAdapt {
|
|
|
|
|
|
|
|
|
|
public italic() {
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
const selection = this.range.getSelectionElementList()
|
|
|
|
|
if (selection?.length) {
|
|
|
|
|
@ -494,7 +494,7 @@ export class CommandAdapt {
|
|
|
|
|
|
|
|
|
|
public underline(textDecoration?: ITextDecoration) {
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
const selection = this.range.getSelectionElementList()
|
|
|
|
|
if (selection?.length) {
|
|
|
|
|
@ -533,7 +533,7 @@ export class CommandAdapt {
|
|
|
|
|
|
|
|
|
|
public strikeout() {
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
const selection = this.range.getSelectionElementList()
|
|
|
|
|
if (selection?.length) {
|
|
|
|
|
@ -558,7 +558,7 @@ export class CommandAdapt {
|
|
|
|
|
|
|
|
|
|
public superscript() {
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
const selection = this.range.getSelectionElementList()
|
|
|
|
|
if (!selection) return
|
|
|
|
|
@ -588,7 +588,7 @@ export class CommandAdapt {
|
|
|
|
|
|
|
|
|
|
public subscript() {
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
const selection = this.range.getSelectionElementList()
|
|
|
|
|
if (!selection) return
|
|
|
|
|
@ -618,7 +618,7 @@ export class CommandAdapt {
|
|
|
|
|
|
|
|
|
|
public color(payload: string | null) {
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
const selection = this.range.getSelectionElementList()
|
|
|
|
|
if (selection?.length) {
|
|
|
|
|
@ -650,7 +650,7 @@ export class CommandAdapt {
|
|
|
|
|
|
|
|
|
|
public highlight(payload: string | null) {
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
const selection = this.range.getSelectionElementList()
|
|
|
|
|
if (selection?.length) {
|
|
|
|
|
@ -1782,7 +1782,7 @@ export class CommandAdapt {
|
|
|
|
|
|
|
|
|
|
public image(payload: IDrawImagePayload) {
|
|
|
|
|
const isDisabled =
|
|
|
|
|
this.draw.isReadonly() || this.control.isDisabledControl()
|
|
|
|
|
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
|
|
|
if (isDisabled) return
|
|
|
|
|
const { startIndex, endIndex } = this.range.getRange()
|
|
|
|
|
if (!~startIndex && !~endIndex) return
|
|
|
|
|
|