Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed a bug with Reflection Probe baking would result in an incorrect baking reusing other's Reflection Probe baking
- Fixed volumetric fog being visually chopped or missing when using hardware Dynamic Resolution Scaling.
- Fixed generation of the packed depth pyramid when hardware Dynamic Resolution Scaling is enabled.
- Fixed Decal's UV edit mode with negative UV

### Changed
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static DisplacableRectHandles uvHandles
get
{
if (s_uvHandles == null || s_uvHandles.Equals(null))
s_uvHandles = new DisplacableRectHandles(s_LastColor);
s_uvHandles = new DisplacableRectHandles(s_LastColor, allowsNegative: true);
return s_uvHandles;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ enum NamedEdge { Right, Top, Left, Bottom, None }
Color m_MonochromeHandleColor;
Color m_WireframeColor;
Color m_WireframeColorBehind;
bool allowsNegative;

/// <summary>The position of the center of the box in Handle.matrix space. On plane z=0.</summary>
public Vector2 center { get; set; }
Expand Down Expand Up @@ -58,9 +59,10 @@ public Color baseColor
}
}

public DisplacableRectHandles(Color baseColor)
public DisplacableRectHandles(Color baseColor, bool allowsNegative = false)
{
this.baseColor = baseColor;
this.allowsNegative = allowsNegative;
}

/// <summary>Draw the rect.</summary>
Expand Down Expand Up @@ -258,7 +260,8 @@ public void DrawHandle()
case NamedEdge.Bottom: topPosition.y -= delta; break;
}

EnsureEdgeFacesOutsideForSymetry(theChangedEdge, ref leftPosition, ref rightPosition, ref topPosition, ref bottomPosition);
if (!allowsNegative)
EnsureEdgeFacesOutsideForSymetry(theChangedEdge, ref leftPosition, ref rightPosition, ref topPosition, ref bottomPosition);
}

if (useHomothety)
Expand All @@ -278,13 +281,14 @@ public void DrawHandle()
break;
}

EnsureEdgeFacesOutsideForHomothety(theChangedEdge, ref leftPosition, ref rightPosition, ref topPosition, ref bottomPosition);
if (!allowsNegative)
EnsureEdgeFacesOutsideForHomothety(theChangedEdge, ref leftPosition, ref rightPosition, ref topPosition, ref bottomPosition);
}

var max = new Vector2(rightPosition.x, topPosition.y);
var min = new Vector2(leftPosition.x, bottomPosition.y);

if (!useSymetry && !useHomothety)
if (!useSymetry && !useHomothety && !allowsNegative)
EnsureEdgeFacesOutsideForOtherTransformation(ref max, ref min);

center = (max + min) * .5f;
Expand Down