Add missing commands.

This commit is contained in:
H. Utku Maden 2024-05-16 22:57:38 +03:00
parent 3ae107c83e
commit ab1849a891
2 changed files with 28 additions and 1 deletions

@ -20,7 +20,7 @@ namespace Quik.CommandMachine
public QMat4 ActiveTransforms { get; } public QMat4 ActiveTransforms { get; }
public StyleStack Style { get; } = new StyleStack(new Quik.Style()); public StyleStack Style { get; } = new StyleStack(new Style());
protected CommandEngine() protected CommandEngine()
{ {
@ -99,6 +99,16 @@ namespace Quik.CommandMachine
case Command.PopZ: case Command.PopZ:
_zIndex = _zStack.TryPop(out int zindex) ? zindex : 0; _zIndex = _zStack.TryPop(out int zindex) ? zindex : 0;
break; break;
case Command.PushStyle:
Style.Push(iterator.Dequeue().As<Style>());
break;
case Command.StoreStyle:
Style.Pop();
Style.Push(iterator.Dequeue().As<Style>());
break;
case Command.PopStyle:
Style.Pop();
break;
} }
} }
} }

@ -109,6 +109,23 @@ namespace Quik.CommandMachine
Enqueue(Command.PopZ); Enqueue(Command.PopZ);
} }
public void PushStyle(Style style)
{
Enqueue(Command.PushStyle);
Enqueue(new Frame(style));
}
public void StoreStyle(Style style)
{
Enqueue(Command.StoreStyle);
Enqueue(new Frame(style));
}
public void PopStyle()
{
Enqueue(Command.PopStyle);
}
public void Line(in QLine line) public void Line(in QLine line)
{ {
Enqueue(Command.Line); Enqueue(Command.Line);