mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 22:01:45 +00:00
starting draw mode with right-click now also snaps to the grid or geometry (unless shift or control is used)
This commit is contained in:
parent
43754e3671
commit
94d538434c
4 changed files with 28 additions and 14 deletions
|
@ -204,8 +204,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
renderer.Present();
|
||||
}
|
||||
|
||||
// This gets the aligned and snapped draw position
|
||||
private DrawnVertex GetCurrentPosition()
|
||||
// This returns the aligned and snapped draw position
|
||||
public static DrawnVertex GetCurrentPosition(Vector2D mousemappos, bool snaptonearest, bool snaptogrid, IRenderer2D renderer, List<DrawnVertex> points)
|
||||
{
|
||||
DrawnVertex p = new DrawnVertex();
|
||||
|
||||
|
@ -289,6 +289,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
}
|
||||
|
||||
// This gets the aligned and snapped draw position
|
||||
private DrawnVertex GetCurrentPosition()
|
||||
{
|
||||
return GetCurrentPosition(mousemappos, snaptonearest, snaptogrid, renderer, points);
|
||||
}
|
||||
|
||||
// This draws a point at a specific location
|
||||
public void DrawPointAt(Vector2D pos, bool stitch)
|
||||
{
|
||||
|
|
|
@ -342,8 +342,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
// Start drawing mode
|
||||
DrawGeometryMode drawmode = new DrawGeometryMode();
|
||||
drawmode.DrawPointAt(mousemappos, true);
|
||||
General.Editing.ChangeMode(drawmode);
|
||||
bool snaptogrid = General.Interface.ShiftState ^ General.Interface.SnapToGrid;
|
||||
bool snaptonearest = General.Interface.CtrlState ^ General.Interface.AutoMerge;
|
||||
DrawnVertex v = DrawGeometryMode.GetCurrentPosition(mousemappos, snaptonearest, snaptogrid, renderer, new List<DrawnVertex>());
|
||||
drawmode.DrawPointAt(v.pos, v.stitch);
|
||||
}
|
||||
|
||||
base.OnEditBegin();
|
||||
|
|
|
@ -428,7 +428,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
// Start drawing mode
|
||||
DrawGeometryMode drawmode = new DrawGeometryMode();
|
||||
drawmode.DrawPointAt(mousemappos, true);
|
||||
bool snaptogrid = General.Interface.ShiftState ^ General.Interface.SnapToGrid;
|
||||
bool snaptonearest = General.Interface.CtrlState ^ General.Interface.AutoMerge;
|
||||
DrawnVertex v = DrawGeometryMode.GetCurrentPosition(mousemappos, snaptonearest, snaptogrid, renderer, new List<DrawnVertex>());
|
||||
drawmode.DrawPointAt(v.pos, v.stitch);
|
||||
General.Editing.ChangeMode(drawmode);
|
||||
}
|
||||
|
||||
|
|
|
@ -274,7 +274,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
// Start drawing mode
|
||||
DrawGeometryMode drawmode = new DrawGeometryMode();
|
||||
drawmode.DrawPointAt(mousemappos, true);
|
||||
bool snaptogrid = General.Interface.ShiftState ^ General.Interface.SnapToGrid;
|
||||
bool snaptonearest = General.Interface.CtrlState ^ General.Interface.AutoMerge;
|
||||
DrawnVertex v = DrawGeometryMode.GetCurrentPosition(mousemappos, snaptonearest, snaptogrid, renderer, new List<DrawnVertex>());
|
||||
drawmode.DrawPointAt(v.pos, v.stitch);
|
||||
General.Editing.ChangeMode(drawmode);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue