Update display arrow
This commit is contained in:
@@ -8,16 +8,16 @@
|
||||
|
||||
<div class="row bg-secondary py-2">
|
||||
<div class="col">
|
||||
<StepArrow ObjId="123" StepText="Prova Arrow 01" BlockStyle="@($"fill: #123456;")" StrokeWidth="10" ObjW="650" ObjH="100" StrokeColors="@listBord01"></StepArrow>
|
||||
<StepArrow ObjId="123" StepText="Prova Arrow 01" BlockStyle="@($"fill: #123456;")" StrokeWidth="4" ObjW="650" ObjH="100" StrokeColors="@listBord01" TipAngle="90"></StepArrow>
|
||||
</div>
|
||||
<div class="col">
|
||||
<StepArrow ObjId="456" StepText="Prova Arrow 02" BlockStyle="@($"fill: #456789;")" StrokeWidth="10" ObjW="600" ObjH="100" StrokeColors="@listBord02"></StepArrow>
|
||||
<StepArrow ObjId="456" StepText="Prova Arrow 02" BlockStyle="@($"fill: #456789;")" StrokeWidth="4" ObjW="600" ObjH="100" StrokeColors="@listBord02" TipAngle="60"></StepArrow>
|
||||
</div>
|
||||
<div class="col">
|
||||
<StepArrow ObjId="456" StepText="Prova Arrow 03" BlockStyle="@($"fill: #6789AB;")" StrokeWidth="3" ObjW="500" ObjH="100" StrokeColors="@listBord01"></StepArrow>
|
||||
<StepArrow ObjId="456" StepText="Prova Arrow 03" BlockStyle="@($"fill: #6789AB;")" StrokeWidth="4" ObjW="500" ObjH="100" StrokeColors="@listBord03" TipAngle="120"></StepArrow>
|
||||
</div>
|
||||
<div class="col">
|
||||
<StepArrow ObjId="456" StepText="Prova Arrow 04" BlockStyle="@($"fill: #89ABCD;")" StrokeWidth="0" ObjW="700" ObjH="100"></StepArrow>
|
||||
<StepArrow ObjId="456" StepText="Prova Arrow 04" BlockStyle="@($"fill: #89ABCD;")" StrokeWidth="0" ObjW="700" ObjH="100" TipAngle="108"></StepArrow>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -42,10 +42,16 @@
|
||||
listBord02.Add("White");
|
||||
listBord02.Add("");
|
||||
listBord02.Add("White");
|
||||
listBord03 = new();
|
||||
listBord03.Add("");
|
||||
listBord03.Add("White");
|
||||
listBord03.Add("");
|
||||
listBord03.Add("Blue");
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected List<string> listBord01 { get; set; } = new();
|
||||
protected List<string> listBord02 { get; set; } = new();
|
||||
protected List<string> listBord03 { get; set; } = new();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace EgwCoreLib.Razor
|
||||
/// Angolo della freccia
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public int SkewAngle { get; set; } = 36;
|
||||
public int TipAngle { get; set; } = 108;
|
||||
|
||||
/// <summary>
|
||||
/// Testo da mostrare
|
||||
@@ -65,9 +65,17 @@ namespace EgwCoreLib.Razor
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Angolo in radianti
|
||||
/// </summary>
|
||||
protected double radAngle
|
||||
{
|
||||
get => TipAngle * (Math.PI / 180);
|
||||
}
|
||||
|
||||
protected int deltaX
|
||||
{
|
||||
get => (int)Math.Round(rectH * Math.Sin(Math.PI * SkewAngle / 180), 0);
|
||||
get => (int)Math.Round((rectH / 2) / Math.Tan(radAngle / 2), 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -82,10 +90,14 @@ namespace EgwCoreLib.Razor
|
||||
if (StrokeColors.Count == 4)
|
||||
{
|
||||
var pList = pointList;
|
||||
lineList.Add($"{pList[0]} {pList[1]}", StrokeColors[0]);
|
||||
lineList.Add($"{pList[1]} {pList[2]} {pList[3]}", StrokeColors[1]);
|
||||
lineList.Add($"{pList[3]} {pList[4]}", StrokeColors[2]);
|
||||
lineList.Add($"{pList[4]} {pList[5]} {pList[0]}", StrokeColors[3]);
|
||||
if (!string.IsNullOrEmpty(StrokeColors[0]))
|
||||
lineList.Add($"{pList[0]} {pList[1]}", StrokeColors[0]);
|
||||
if (!string.IsNullOrEmpty(StrokeColors[1]))
|
||||
lineList.Add($"{pList[1]} {pList[2]} {pList[3]}", StrokeColors[1]);
|
||||
if (!string.IsNullOrEmpty(StrokeColors[2]))
|
||||
lineList.Add($"{pList[3]} {pList[4]}", StrokeColors[2]);
|
||||
if (!string.IsNullOrEmpty(StrokeColors[3]))
|
||||
lineList.Add($"{pList[4]} {pList[5]} {pList[0]}", StrokeColors[3]);
|
||||
}
|
||||
return lineList;
|
||||
}
|
||||
@@ -101,12 +113,12 @@ namespace EgwCoreLib.Razor
|
||||
{
|
||||
string[] pList = new string[6];
|
||||
// aggiungo 1:1 i punti
|
||||
pList[0] = "0,0";
|
||||
pList[1] = $"{rectW - deltaX},0 ";
|
||||
pList[2] = $"{rectW},{rectH / 2} ";
|
||||
pList[3] = $"{rectW - deltaX},{rectH} ";
|
||||
pList[4] = $"0,{rectH} ";
|
||||
pList[5] = $"{deltaX},{rectH / 2} ";
|
||||
pList[0] = $"{StrokeWidth},{StrokeWidth}";
|
||||
pList[1] = $"{rectW - deltaX},{StrokeWidth}";
|
||||
pList[2] = $"{rectW},{rectH / 2}";
|
||||
pList[3] = $"{rectW - deltaX},{rectH}";
|
||||
pList[4] = $"{StrokeWidth},{rectH}";
|
||||
pList[5] = $"{deltaX},{rectH / 2}";
|
||||
return pList;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user