Comment sizes and color fixed

This commit is contained in:
barsdeveloper
2022-12-10 12:42:09 +01:00
parent 97d4b18347
commit f1fc015453
12 changed files with 116 additions and 37 deletions

View File

@@ -73,12 +73,9 @@ export default class LinearColorEntity extends IEntity {
const r = this.R.value
const g = this.G.value
const b = this.B.value
if (
!(Math.abs(r - g) > Number.EPSILON)
&& !(Math.abs(r - b) > Number.EPSILON)
&& !(Math.abs(g - b) > Number.EPSILON)
) {
this.V.value = 0
if (Utility.approximatelyEqual(r, g) && Utility.approximatelyEqual(r, b) && Utility.approximatelyEqual(g, b)) {
this.S.value = 0
this.V.value = r
return
}
const max = Math.max(r, g, b)

View File

@@ -155,8 +155,24 @@ export default class ObjectEntity extends IEntity {
this.getType() == Configuration.nodeType.comment ? Configuration.defaultCommentWidth : undefined
}
/** @param {Number} value */
setNodeWidth(value) {
if (!this.NodeWidth) {
this.NodeWidth = new IntegerEntity()
}
this.NodeWidth.value = value
}
getNodeHeight() {
return this.NodeHeight ??
this.getType() == Configuration.nodeType.comment ? Configuration.defaultCommentHeight : undefined
}
/** @param {Number} value */
setNodeHeight(value) {
if (!this.NodeHeight) {
this.NodeHeight = new IntegerEntity()
}
this.NodeHeight.value = value
}
}