1f9b284de2
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> # Conflicts: # Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin_precompiled.h # Code/Editor/Plugins/EditorCommon/EditorCommon_precompiled.h # Code/Editor/Plugins/EditorCommon/stdafx.cpp # Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin_precompiled.h # Code/Editor/Plugins/PerforcePlugin/PerforcePlugin_precompiled.h # Code/Editor/Plugins/ProjectSettingsTool/ProjectSettingsTool_precompiled.h # Code/Framework/AzToolsFramework/AzToolsFramework/AzToolsFramework_precompiled.h # Code/Tools/AssetProcessor/native/precompiled.h # Code/Tools/Standalone/StandaloneTools_precompiled.h # Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer_precompiled.h # Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageProcessing_precompiled.h # Gems/Atom/RHI/DX12/Code/Source/RHI/Atom_RHI_DX12_precompiled.h # Gems/Atom/RHI/Metal/Code/Include/Platform/Mac/Atom_RHI_Metal_precompiled_Platform.h # Gems/Atom/RHI/Metal/Code/Include/Platform/iOS/Atom_RHI_Metal_precompiled_Platform.h # Gems/Atom/RHI/Metal/Code/Source/Atom_RHI_Metal_precompiled.h # Gems/Atom/RHI/Metal/Code/atom_rhi_metal_common_files.cmake # Gems/Atom/RHI/Null/Code/Source/Atom_RHI_Null_precompiled.h # Gems/Atom/RHI/Null/Code/atom_rhi_null_common_files.cmake # Gems/Atom/RHI/Vulkan/Code/Include/Platform/Android/Atom_RHI_Vulkan_precompiled_Platform.h # Gems/Atom/RHI/Vulkan/Code/Include/Platform/Linux/Atom_RHI_Vulkan_precompiled_Platform.h # Gems/Atom/RHI/Vulkan/Code/Include/Platform/Mac/Atom_RHI_Vulkan_precompiled_Platform.h # Gems/Atom/RHI/Vulkan/Code/Include/Platform/Windows/Atom_RHI_Vulkan_precompiled_Platform.h # Gems/Atom/RHI/Vulkan/Code/Source/Atom_RHI_Vulkan_precompiled.h # Gems/Atom/RHI/Vulkan/Code/Source/RHI/SwapChain.cpp # Gems/Atom/RHI/Vulkan/Code/atom_rhi_vulkan_common_files.cmake # Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/AtomFont_precompiled.h # Gems/Blast/Code/Source/StdAfx.cpp # Gems/Camera/Code/Source/Camera_precompiled.h # Gems/EMotionFX/Code/Source/EMotionFX_precompiled.h # Gems/FastNoise/Code/Source/FastNoise_precompiled.h # Gems/Gestures/Code/Source/Gestures_precompiled.h # Gems/GradientSignal/Code/Source/GradientSignal_precompiled.h # Gems/GraphCanvas/Code/precompiled.h # Gems/ImGui/Code/Source/ImGui_precompiled.h # Gems/InAppPurchases/Code/Source/InAppPurchases_precompiled.h # Gems/LmbrCentral/Code/Source/LmbrCentral_precompiled.h # Gems/LmbrCentral/Code/Tests/ShapeGeometryUtilTest.cpp # Gems/LyShine/Code/Editor/UiCanvasEditor_precompiled.h # Gems/LyShine/Code/Source/Animation/LyShine_precompiled.h # Gems/LyShine/Code/Source/LyShine_precompiled.h # Gems/LyShineExamples/Code/Source/LyShineExamples_precompiled.h # Gems/Maestro/Code/Source/Cinematics/Maestro_precompiled.h # Gems/Maestro/Code/Source/Maestro_precompiled.h # Gems/MessagePopup/Code/Source/MessagePopup_precompiled.h # Gems/Metastream/Code/Source/Metastream_precompiled.h # Gems/Microphone/Code/Source/Microphone_precompiled.h # Gems/Multiplayer/Code/Source/Multiplayer_precompiled.h # Gems/PhysX/Code/NumericalMethods/Source/NumericalMethods_precompiled.h # Gems/PhysX/Code/Source/PhysXUnsupported_precompiled.h # Gems/PhysX/Code/Source/PhysX_precompiled.h # Gems/PhysX/Code/physx_unsupported_files.cmake # Gems/PhysXDebug/Code/Source/PhysXDebugUnsupported_precompiled.h # Gems/PhysXDebug/Code/Source/PhysXDebug_precompiled.h # Gems/ScriptCanvas/Code/Editor/precompiled.h # Gems/ScriptCanvas/Code/Source/precompiled.h # Gems/ScriptCanvasDeveloper/Code/Source/precompiled.h # Gems/ScriptCanvasPhysics/Code/Source/ScriptCanvasPhysics_precompiled.h # Gems/ScriptEvents/Code/Source/precompiled.h # Gems/ScriptEvents/Code/Tests/Editor/EditorTests.cpp # Gems/ScriptedEntityTweener/Code/Source/ScriptedEntityTweener_precompiled.h # Gems/SliceFavorites/Code/Source/SliceFavorites_precompiled.h # Gems/StartingPointCamera/Code/Source/StartingPointCamera_precompiled.h # Gems/StartingPointInput/Code/Source/StartingPointInput_precompiled.h # Gems/StartingPointMovement/Code/Source/StartingPointMovement_precompiled.h # Gems/SurfaceData/Code/Source/SurfaceData_precompiled.h # Gems/TextureAtlas/Code/Source/TextureAtlas_precompiled.h # Gems/TickBusOrderViewer/Code/Source/TickBusOrderViewer_precompiled.h # Gems/Twitch/Code/Source/Twitch_precompiled.h # Gems/VirtualGamepad/Code/Source/VirtualGamepad_precompiled.h # Gems/WhiteBox/Code/Source/WhiteBoxUnsupported_precompiled.h # Gems/WhiteBox/Code/Source/WhiteBox_precompiled.h
291 lines
15 KiB
C++
291 lines
15 KiB
C++
/*
|
|
* Copyright (c) Contributors to the Open 3D Engine Project.
|
|
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
*
|
|
*/
|
|
#include "EditorCommon.h"
|
|
|
|
ViewportAnchor::ViewportAnchor()
|
|
: m_anchorWhole(new ViewportIcon("Editor/Icons/Viewport/Anchor_Whole.tif"))
|
|
, m_anchorLeft(new ViewportIcon("Editor/Icons/Viewport/Anchor_Left.tif"))
|
|
, m_anchorLeftTop(new ViewportIcon("Editor/Icons/Viewport/Anchor_TopLeft.tif"))
|
|
, m_dottedLine(new ViewportIcon("Editor/Icons/Viewport/DottedLine.tif"))
|
|
{
|
|
}
|
|
|
|
ViewportAnchor::~ViewportAnchor()
|
|
{
|
|
}
|
|
|
|
void ViewportAnchor::Draw(Draw2dHelper& draw2d, AZ::Entity* element, bool drawUnTransformedRect, bool drawAnchorLines, bool drawLinesToParent,
|
|
bool anchorInteractionEnabled, ViewportHelpers::SelectedAnchors highlightedAnchors) const
|
|
{
|
|
if (!element || ViewportHelpers::IsControlledByLayout(element))
|
|
{
|
|
// Don't draw anything if there is no element or it's controlled by a layout.
|
|
return;
|
|
}
|
|
|
|
// check that the element is using transform2d - if not then can't draw the anchors
|
|
if (!UiTransform2dBus::FindFirstHandler(element->GetId()))
|
|
{
|
|
return;
|
|
}
|
|
|
|
AZ::Entity* parentElement = EntityHelpers::GetParentElement(element);
|
|
|
|
// get the anchors from the element's transform component
|
|
UiTransform2dInterface::Anchors anchors;
|
|
EBUS_EVENT_ID_RESULT(anchors, element->GetId(), UiTransform2dBus, GetAnchors);
|
|
// get the parent element's pre-transform points and its transform.
|
|
// The anchors are in terms of the parent's space
|
|
UiTransformInterface::RectPoints parentPoints;
|
|
EBUS_EVENT_ID(parentElement->GetId(), UiTransformBus, GetCanvasSpacePointsNoScaleRotate, parentPoints);
|
|
|
|
AZ::Vector2 parentSize = parentPoints.GetAxisAlignedSize();
|
|
|
|
AZ::Matrix4x4 parentTransform;
|
|
EBUS_EVENT_ID(parentElement->GetId(), UiTransformBus, GetTransformToViewport, parentTransform);
|
|
|
|
UiTransformInterface::RectPoints elemRect;
|
|
EBUS_EVENT_ID(element->GetId(), UiTransformBus, GetCanvasSpacePointsNoScaleRotate, elemRect);
|
|
|
|
// Here we optionally draw a rect outline, either the element's rect or the parent element's
|
|
// rect depending on the situation
|
|
if (drawUnTransformedRect || drawLinesToParent)
|
|
{
|
|
UiTransformInterface::RectPoints rectPointsToDraw;
|
|
if (drawLinesToParent)
|
|
{
|
|
// If we are going to draw distance lines to the parent then draw the parent rectangle
|
|
rectPointsToDraw = parentPoints.Transform(parentTransform);
|
|
}
|
|
else
|
|
{
|
|
// drawUnTransformedRect must be true
|
|
// we draw the outline of this element's rect before its local rotate and scale
|
|
// the untransformed rect we want to draw has all the parents' transforms but not this element's transforms
|
|
// so transform the NoScaleRotate with the parent transform
|
|
rectPointsToDraw = elemRect.Transform(parentTransform);
|
|
}
|
|
|
|
AZ::Color rectColor(1.0f, 1.0f, 1.0f, 0.2f);
|
|
|
|
draw2d.DrawLine(rectPointsToDraw.TopLeft(), rectPointsToDraw.TopRight(), rectColor); // top
|
|
draw2d.DrawLine(rectPointsToDraw.TopRight(), rectPointsToDraw.BottomRight(), rectColor); // right
|
|
draw2d.DrawLine(rectPointsToDraw.BottomRight(), rectPointsToDraw.BottomLeft(), rectColor); // bottom
|
|
draw2d.DrawLine(rectPointsToDraw.BottomLeft(), rectPointsToDraw.TopLeft(), rectColor); // left
|
|
}
|
|
|
|
if (drawLinesToParent)
|
|
{
|
|
// When moving the anchors (or if we are highlighting them) we draw lines from the anchors
|
|
// to the parent rectangle to make it clear that the anchors are normalized distances from
|
|
// the edges of the parent
|
|
DrawAnchorToParentLines(draw2d, anchors, parentPoints, parentTransform, highlightedAnchors);
|
|
|
|
// if moving the anchors we do not want to draw the lines from the anchors to the element rect
|
|
drawAnchorLines = false;
|
|
}
|
|
|
|
// we draw the anchors in a different color if anchor interaction is disabled
|
|
AZ::Color anchorColor = (anchorInteractionEnabled) ? ViewportHelpers::anchorColor : ViewportHelpers::anchorColorDisabled;
|
|
|
|
// the anchors we draw depend on whether the left/right and top/bottom anchors are together or split apart
|
|
if (anchors.m_left == anchors.m_right)
|
|
{
|
|
if (anchors.m_top == anchors.m_bottom)
|
|
{
|
|
// all anchors together
|
|
AZ::Vector2 anchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_left, anchors.m_top);
|
|
|
|
if (drawAnchorLines)
|
|
{
|
|
AZ::Vector2 pivot;
|
|
EBUS_EVENT_ID_RESULT(pivot, element->GetId(), UiTransformBus, GetCanvasSpacePivotNoScaleRotate);
|
|
m_dottedLine->DrawAnchorLines(draw2d, anchorPos, pivot, parentTransform, true, true, true);
|
|
}
|
|
|
|
m_anchorWhole->Draw(draw2d, anchorPos, parentTransform, 0.0f, anchorColor);
|
|
}
|
|
else
|
|
{
|
|
// stretching vertically
|
|
AZ::Vector2 topAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_left, anchors.m_top);
|
|
AZ::Vector2 bottomAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_left, anchors.m_bottom);
|
|
|
|
if (drawAnchorLines)
|
|
{
|
|
AZ::Vector2 pivot;
|
|
EBUS_EVENT_ID_RESULT(pivot, element->GetId(), UiTransformBus, GetCanvasSpacePivotNoScaleRotate);
|
|
|
|
AZ::Vector2 topTarget;
|
|
AZ::Vector2 bottomTarget;
|
|
ViewportHelpers::GetVerticalTargetPoints(elemRect, topAnchorPos.GetX(), topTarget, bottomTarget);
|
|
|
|
m_dottedLine->DrawAnchorLines(draw2d, topAnchorPos, topTarget, parentTransform, true, false, true);
|
|
m_dottedLine->DrawAnchorLines(draw2d, bottomAnchorPos, bottomTarget, parentTransform, true, false, true);
|
|
m_dottedLine->DrawAnchorLinesSplit(draw2d, topAnchorPos, bottomAnchorPos, pivot, parentTransform, false);
|
|
}
|
|
|
|
m_anchorLeft->Draw(draw2d, topAnchorPos, parentTransform, 90.0f, anchorColor);
|
|
m_anchorLeft->Draw(draw2d, bottomAnchorPos, parentTransform, -90.0f, anchorColor);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (anchors.m_top == anchors.m_bottom)
|
|
{
|
|
// stretching horizontally
|
|
AZ::Vector2 leftAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_left, anchors.m_top);
|
|
AZ::Vector2 rightAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_right, anchors.m_top);
|
|
|
|
if (drawAnchorLines)
|
|
{
|
|
AZ::Vector2 pivot;
|
|
EBUS_EVENT_ID_RESULT(pivot, element->GetId(), UiTransformBus, GetCanvasSpacePivotNoScaleRotate);
|
|
|
|
AZ::Vector2 leftTarget;
|
|
AZ::Vector2 rightTarget;
|
|
ViewportHelpers::GetHorizTargetPoints(elemRect, leftAnchorPos.GetY(), leftTarget, rightTarget);
|
|
|
|
m_dottedLine->DrawAnchorLines(draw2d, leftAnchorPos, leftTarget, parentTransform, false, true, false);
|
|
m_dottedLine->DrawAnchorLines(draw2d, rightAnchorPos, rightTarget, parentTransform, false, true, false);
|
|
m_dottedLine->DrawAnchorLinesSplit(draw2d, leftAnchorPos, rightAnchorPos, pivot, parentTransform, true);
|
|
}
|
|
|
|
m_anchorLeft->Draw(draw2d, leftAnchorPos, parentTransform, 0.0f, anchorColor);
|
|
m_anchorLeft->Draw(draw2d, rightAnchorPos, parentTransform, 180.0f, anchorColor);
|
|
}
|
|
else
|
|
{
|
|
// stretching in both directions
|
|
AZ::Vector2 topLeftAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_left, anchors.m_top);
|
|
AZ::Vector2 topRightAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_right, anchors.m_top);
|
|
AZ::Vector2 bottomRightAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_right, anchors.m_bottom);
|
|
AZ::Vector2 bottomLeftAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_left, anchors.m_bottom);
|
|
|
|
if (drawAnchorLines)
|
|
{
|
|
AZ::Vector2 pivot;
|
|
EBUS_EVENT_ID_RESULT(pivot, element->GetId(), UiTransformBus, GetCanvasSpacePivotNoScaleRotate);
|
|
|
|
AZ::Vector2 anchorMidpoint = (topLeftAnchorPos + bottomRightAnchorPos) * 0.5f;
|
|
|
|
AZ::Vector2 leftTarget;
|
|
AZ::Vector2 rightTarget;
|
|
ViewportHelpers::GetHorizTargetPoints(elemRect, anchorMidpoint.GetY(), leftTarget, rightTarget);
|
|
|
|
AZ::Vector2 topTarget;
|
|
AZ::Vector2 bottomTarget;
|
|
ViewportHelpers::GetVerticalTargetPoints(elemRect, anchorMidpoint.GetX(), topTarget, bottomTarget);
|
|
|
|
m_dottedLine->DrawAnchorLinesSplit(draw2d, topLeftAnchorPos, topRightAnchorPos, topTarget, parentTransform, true);
|
|
m_dottedLine->DrawAnchorLinesSplit(draw2d, bottomLeftAnchorPos, bottomRightAnchorPos, bottomTarget, parentTransform, true);
|
|
m_dottedLine->DrawAnchorLinesSplit(draw2d, topLeftAnchorPos, bottomLeftAnchorPos, leftTarget, parentTransform, false);
|
|
m_dottedLine->DrawAnchorLinesSplit(draw2d, topRightAnchorPos, bottomRightAnchorPos, rightTarget, parentTransform, false);
|
|
}
|
|
|
|
m_anchorLeftTop->Draw(draw2d, topLeftAnchorPos, parentTransform, 0.0f, anchorColor);
|
|
m_anchorLeftTop->Draw(draw2d, topRightAnchorPos, parentTransform, 90.0f, anchorColor);
|
|
m_anchorLeftTop->Draw(draw2d, bottomRightAnchorPos, parentTransform, 180.0f, anchorColor);
|
|
m_anchorLeftTop->Draw(draw2d, bottomLeftAnchorPos, parentTransform, -90.0f, anchorColor);
|
|
}
|
|
}
|
|
|
|
// If the user is hovering over any anchors, highlight them
|
|
if (highlightedAnchors.All())
|
|
{
|
|
AZ::Vector2 anchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_left, anchors.m_top);
|
|
m_anchorWhole->Draw(draw2d, anchorPos, parentTransform, 0.0f, ViewportHelpers::highlightColor);
|
|
}
|
|
else if (highlightedAnchors.TopLeft())
|
|
{
|
|
AZ::Vector2 topLeftAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_left, anchors.m_top);
|
|
m_anchorLeftTop->Draw(draw2d, topLeftAnchorPos, parentTransform, 0.0f, ViewportHelpers::highlightColor);
|
|
}
|
|
else if (highlightedAnchors.TopRight())
|
|
{
|
|
AZ::Vector2 topRightAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_right, anchors.m_top);
|
|
m_anchorLeftTop->Draw(draw2d, topRightAnchorPos, parentTransform, 90.0f, ViewportHelpers::highlightColor);
|
|
}
|
|
else if (highlightedAnchors.BottomRight())
|
|
{
|
|
AZ::Vector2 bottomRightAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_right, anchors.m_bottom);
|
|
m_anchorLeftTop->Draw(draw2d, bottomRightAnchorPos, parentTransform, 180.0f, ViewportHelpers::highlightColor);
|
|
}
|
|
else if (highlightedAnchors.BottomLeft())
|
|
{
|
|
AZ::Vector2 bottomLeftAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_left, anchors.m_bottom);
|
|
m_anchorLeftTop->Draw(draw2d, bottomLeftAnchorPos, parentTransform, -90.0f, ViewportHelpers::highlightColor);
|
|
}
|
|
else if (highlightedAnchors.m_top)
|
|
{
|
|
AZ::Vector2 topAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_left, anchors.m_top);
|
|
m_anchorLeft->Draw(draw2d, topAnchorPos, parentTransform, 90.0f, ViewportHelpers::highlightColor);
|
|
}
|
|
else if (highlightedAnchors.m_bottom)
|
|
{
|
|
AZ::Vector2 bottomAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_left, anchors.m_bottom);
|
|
m_anchorLeft->Draw(draw2d, bottomAnchorPos, parentTransform, -90.0f, ViewportHelpers::highlightColor);
|
|
}
|
|
else if (highlightedAnchors.m_left)
|
|
{
|
|
AZ::Vector2 leftAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_left, anchors.m_top);
|
|
m_anchorLeft->Draw(draw2d, leftAnchorPos, parentTransform, 0.0f, ViewportHelpers::highlightColor);
|
|
}
|
|
else if (highlightedAnchors.m_right)
|
|
{
|
|
AZ::Vector2 rightAnchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, anchors.m_right, anchors.m_top);
|
|
m_anchorLeft->Draw(draw2d, rightAnchorPos, parentTransform, 180.0f, ViewportHelpers::highlightColor);
|
|
}
|
|
}
|
|
|
|
void ViewportAnchor::DrawAnchorToParentLines(Draw2dHelper& draw2d, const UiTransform2dInterface::Anchors& anchors,
|
|
const UiTransformInterface::RectPoints& parentPoints, const AZ::Matrix4x4& transform,
|
|
ViewportHelpers::SelectedAnchors highlightedAnchors) const
|
|
{
|
|
bool drawHoriz = true;
|
|
bool drawVert = true;
|
|
|
|
// if we have just one side of the anchors selected we only draw one line
|
|
if (!highlightedAnchors.All() && highlightedAnchors.Any())
|
|
{
|
|
if (!(highlightedAnchors.m_left || highlightedAnchors.m_right))
|
|
{
|
|
// we are dragging up/down only
|
|
drawHoriz = false;
|
|
}
|
|
else if (!(highlightedAnchors.m_top || highlightedAnchors.m_bottom))
|
|
{
|
|
// we are dragging left/right only
|
|
drawVert = false;
|
|
}
|
|
}
|
|
|
|
AZ::Vector2 parentSize = parentPoints.GetAxisAlignedSize();
|
|
|
|
float horizAnchorVal = (highlightedAnchors.m_left) ? anchors.m_left : anchors.m_right;
|
|
float vertAnchorVal = (highlightedAnchors.m_top) ? anchors.m_top : anchors.m_bottom;
|
|
|
|
AZ::Vector2 anchorPos = ViewportHelpers::ComputeAnchorPoint(parentPoints.TopLeft(), parentSize, horizAnchorVal, vertAnchorVal);
|
|
|
|
if (drawHoriz)
|
|
{
|
|
// draw distance line horizontally from the anchor pos to the left edge of the parent rect
|
|
// The distance value is the anchor value (0 - 1 range)
|
|
AZ::Vector2 targetPosLeft(parentPoints.TopLeft().GetX(), anchorPos.GetY());
|
|
m_dottedLine->DrawDistanceLineWithTransform(draw2d, anchorPos, targetPosLeft, transform, horizAnchorVal * 100.0f, "%");
|
|
}
|
|
|
|
if (drawVert)
|
|
{
|
|
// draw distance line vertically from the anchor pos to the top edge of the parent rect
|
|
// The distance value is the anchor value (0 - 1 range)
|
|
AZ::Vector2 targetPosTop(anchorPos.GetX(), parentPoints.TopLeft().GetY());
|
|
m_dottedLine->DrawDistanceLineWithTransform(draw2d, anchorPos, targetPosTop, transform, vertAnchorVal * 100.0f, "%");
|
|
}
|
|
}
|