mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 18:08:12 +08:00
Fix grid overlay color showing as none
This commit is contained in:
@@ -812,6 +812,7 @@ export class CheckboxInput extends WidgetProps {
|
||||
|
||||
export class ColorButton extends WidgetProps {
|
||||
@Transform(({ value }) => {
|
||||
if (value instanceof Gradient) return value;
|
||||
const gradient = value["Gradient"];
|
||||
if (gradient) {
|
||||
const stops = gradient.map(([position, color]: [number, color: { red: number; green: number; blue: number; alpha: number }]) => ({
|
||||
@@ -821,6 +822,7 @@ export class ColorButton extends WidgetProps {
|
||||
return new Gradient(stops);
|
||||
}
|
||||
|
||||
if (value instanceof Color) return value;
|
||||
const solid = value["Solid"];
|
||||
if (solid) {
|
||||
return new Color(solid.red, solid.green, solid.blue, solid.alpha);
|
||||
|
||||
@@ -95,7 +95,8 @@ impl log::Log for WasmLog {
|
||||
|
||||
let file = record.file().unwrap_or_else(|| record.target());
|
||||
let line = record.line().map_or_else(|| "[Unknown]".to_string(), |line| line.to_string());
|
||||
let msg = &format!("%c{} {file}:{line} \n{}%c", name, record.args());
|
||||
let args = record.args();
|
||||
let msg = &format!("%c{name}\t{file}:{line}\n{args}"); // The %c is replaced by the message color
|
||||
log(msg, color)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user