@@ -569,6 +569,9 @@ namespace FlaxEditor.Surface.Archetypes
|
|||||||
// Grid
|
// Grid
|
||||||
_node.DrawEditorGrid(ref rect);
|
_node.DrawEditorGrid(ref rect);
|
||||||
|
|
||||||
|
var features = Render2D.Features;
|
||||||
|
Render2D.Features = features & ~Render2D.RenderingFeatures.VertexSnapping;
|
||||||
|
|
||||||
base.Draw();
|
base.Draw();
|
||||||
|
|
||||||
// Draw debug position
|
// Draw debug position
|
||||||
@@ -584,6 +587,8 @@ namespace FlaxEditor.Surface.Archetypes
|
|||||||
Render2D.DrawSprite(icon, debugRect, style.ProgressNormal);
|
Render2D.DrawSprite(icon, debugRect, style.ProgressNormal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Render2D.Features = features;
|
||||||
|
|
||||||
// Frame
|
// Frame
|
||||||
var frameColor = containsFocus ? style.BackgroundSelected : (IsMouseOver ? style.ForegroundGrey : style.ForegroundDisabled);
|
var frameColor = containsFocus ? style.BackgroundSelected : (IsMouseOver ? style.ForegroundGrey : style.ForegroundDisabled);
|
||||||
Render2D.DrawRectangle(new Rectangle(1, 1, rect.Width - 2, rect.Height - 2), frameColor);
|
Render2D.DrawRectangle(new Rectangle(1, 1, rect.Width - 2, rect.Height - 2), frameColor);
|
||||||
|
|||||||
@@ -190,7 +190,6 @@ namespace FlaxEditor.Surface.Archetypes
|
|||||||
public override void Draw()
|
public override void Draw()
|
||||||
{
|
{
|
||||||
var style = Style.Current;
|
var style = Style.Current;
|
||||||
|
|
||||||
var backgroundRect = new Rectangle(Float2.Zero, Size);
|
var backgroundRect = new Rectangle(Float2.Zero, Size);
|
||||||
|
|
||||||
// Shadow
|
// Shadow
|
||||||
@@ -201,7 +200,7 @@ namespace FlaxEditor.Surface.Archetypes
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Background
|
// Background
|
||||||
Render2D.FillRectangle(backgroundRect, ArchetypeColor);
|
Render2D.FillRectangle(backgroundRect, BackgroundColor);
|
||||||
|
|
||||||
// Breakpoint hit
|
// Breakpoint hit
|
||||||
if (Breakpoint.Hit)
|
if (Breakpoint.Hit)
|
||||||
@@ -819,10 +818,10 @@ namespace FlaxEditor.Surface.Archetypes
|
|||||||
{
|
{
|
||||||
base.OnSurfaceLoaded(action);
|
base.OnSurfaceLoaded(action);
|
||||||
|
|
||||||
|
var node = Node;
|
||||||
if (action == SurfaceNodeActions.Undo)
|
if (action == SurfaceNodeActions.Undo)
|
||||||
{
|
{
|
||||||
// Update parent node layout when restoring decorator from undo
|
// Update parent node layout when restoring decorator from undo
|
||||||
var node = Node;
|
|
||||||
if (node != null)
|
if (node != null)
|
||||||
{
|
{
|
||||||
node._decorators = null;
|
node._decorators = null;
|
||||||
@@ -832,7 +831,7 @@ namespace FlaxEditor.Surface.Archetypes
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Correctly size decorators when surface is loaded
|
// Correctly size decorators when surface is loaded
|
||||||
Node.ResizeAuto();
|
node?.ResizeAuto();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -932,7 +932,7 @@ namespace FlaxEditor.Surface.Archetypes
|
|||||||
new NodeArchetype
|
new NodeArchetype
|
||||||
{
|
{
|
||||||
TypeID = 36,
|
TypeID = 36,
|
||||||
Title = "HSVToRGB",
|
Title = "HSV To RGB",
|
||||||
Description = "Converts a HSV value to linear RGB [X = 0/360, Y = 0/1, Z = 0/1]",
|
Description = "Converts a HSV value to linear RGB [X = 0/360, Y = 0/1, Z = 0/1]",
|
||||||
Flags = NodeFlags.MaterialGraph,
|
Flags = NodeFlags.MaterialGraph,
|
||||||
Size = new Float2(160, 25),
|
Size = new Float2(160, 25),
|
||||||
@@ -949,7 +949,7 @@ namespace FlaxEditor.Surface.Archetypes
|
|||||||
new NodeArchetype
|
new NodeArchetype
|
||||||
{
|
{
|
||||||
TypeID = 37,
|
TypeID = 37,
|
||||||
Title = "RGBToHSV",
|
Title = "RGB To HSV",
|
||||||
Description = "Converts a linear RGB value to HSV [X = 0/360, Y = 0/1, Z = 0/1]",
|
Description = "Converts a linear RGB value to HSV [X = 0/360, Y = 0/1, Z = 0/1]",
|
||||||
Flags = NodeFlags.MaterialGraph,
|
Flags = NodeFlags.MaterialGraph,
|
||||||
Size = new Float2(160, 25),
|
Size = new Float2(160, 25),
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace FlaxEditor.Surface
|
|||||||
public const float NodeMarginY = 8.0f;
|
public const float NodeMarginY = 8.0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The width of the row that is started by a box.
|
/// The size of the row that is started by a box.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const float BoxRowHeight = 19.0f;
|
public const float BoxRowHeight = 19.0f;
|
||||||
|
|
||||||
|
|||||||
@@ -511,7 +511,7 @@ namespace FlaxEditor.Surface
|
|||||||
{
|
{
|
||||||
GroupID = Custom.GroupID,
|
GroupID = Custom.GroupID,
|
||||||
Name = "Custom",
|
Name = "Custom",
|
||||||
Color = Color.Wheat
|
Color = Color.Wheat.RGBMultiplied(0.4f),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ namespace FlaxEngine
|
|||||||
/// <returns>Offseted rectangle.</returns>
|
/// <returns>Offseted rectangle.</returns>
|
||||||
public Rectangle MakeOffsetted(float offset)
|
public Rectangle MakeOffsetted(float offset)
|
||||||
{
|
{
|
||||||
return new Rectangle(Location + new Float2(offset, offset), Size);
|
return new Rectangle(Location + offset, Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user