Fix sliders

This commit is contained in:
barsdeveloper
2024-11-26 21:15:01 +01:00
parent 5c26c95b5d
commit 4cdcae1493
4 changed files with 21 additions and 1 deletions

4
dist/ueblueprint.js vendored
View File

@@ -3361,6 +3361,10 @@ class ColorChannelEntity extends IEntity {
valueOf() {
return this.value
}
toString() {
return this.value.toString()
}
}
class LinearColorEntity extends IEntity {

File diff suppressed because one or more lines are too long

View File

@@ -30,4 +30,8 @@ export default class ColorChannelEntity extends IEntity {
valueOf() {
return this.value
}
toString() {
return this.value.toString()
}
}

View File

@@ -276,6 +276,18 @@ test("Boolean", () => {
expect(BooleanEntity.flagSerialized().grammar.parse("true").serialize()).toEqual(`"true"`)
})
test("ColorChannelEntity", () => {
let grammar = ColorChannelEntity.grammar
let value = grammar.parse("0.45")
expect(value).toBeInstanceOf(ColorChannelEntity)
expect(value).toEqual(new ColorChannelEntity(0.45))
expect(value.serialize()).toBe("0.450000")
expect(value.equals(new (ColorChannelEntity.withDefault().flagNullable())(0.45))).toBeTruthy()
expect(value.valueOf()).toBe(0.45)
expect(value.toString()).toBe("0.45")
})
test("FormatTextEntity", () => {
let grammar = FormatTextEntity.grammar
let grammar2 = FormatTextEntity.flagSerialized().grammar