mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
Fix sliders
This commit is contained in:
4
dist/ueblueprint.js
vendored
4
dist/ueblueprint.js
vendored
@@ -3361,6 +3361,10 @@ class ColorChannelEntity extends IEntity {
|
||||
valueOf() {
|
||||
return this.value
|
||||
}
|
||||
|
||||
toString() {
|
||||
return this.value.toString()
|
||||
}
|
||||
}
|
||||
|
||||
class LinearColorEntity extends IEntity {
|
||||
|
||||
2
dist/ueblueprint.min.js
vendored
2
dist/ueblueprint.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -30,4 +30,8 @@ export default class ColorChannelEntity extends IEntity {
|
||||
valueOf() {
|
||||
return this.value
|
||||
}
|
||||
|
||||
toString() {
|
||||
return this.value.toString()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user