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 @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed volumetric fog with XR single-pass rendering.
- Fixed issues with first frame rendering when RenderGraph is used (auto exposure, AO)
- Fixed AOV api in render graph (case 1296605)
- Fixed a small discrepancy in the marker placement in light intensity sliders (case 1299750)

### Changed
- Removed the material pass probe volumes evaluation mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ static class SliderConfig
public const float k_MarkerHeight = 2;
public const float k_MarkerTooltipScale = 4;
public const float k_ThumbTooltipSize = 10;
public const float k_KnobSize = 10;
}

protected static class SliderStyles
Expand Down Expand Up @@ -118,11 +119,16 @@ void DoSliderMarker(Rect rect, float position, float value, string tooltip)
// Vertically align with slider.
markerRect.y += (EditorGUIUtility.singleLineHeight / 2f) - 1;

// Horizontally place on slider.
const float halfWidth = width * 0.5f;
markerRect.x = rect.x + rect.width * position;
// Horizontally place on slider. We need to take into account the "knob" size when doing this, because position 0 and 1 starts
// at the center of the knob when it's placed at the left and right corner respectively. We don't do this adjustment when placing
// the marker at the corners (to avoid havind the slider slightly extend past the marker)
float knobSize = (position > 0f && position < 1f) ? SliderConfig.k_KnobSize : 0f;
float start = rect.x + knobSize / 2f;
float range = rect.width - knobSize;
markerRect.x = start + range * position;

// Center the marker on value.
const float halfWidth = width * 0.5f;
markerRect.x -= halfWidth;

// Clamp to the slider edges.
Expand Down