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
11 changes: 7 additions & 4 deletions src/sdk/PnP.Core/Model/SharePoint/Pages/Internal/CanvasColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,13 @@ internal string ToHtml()
bool controlWrittenToSection = false;
int controlIndex = 0;
foreach (var control in Section.Page.Controls.Where(p => p.Section == Section && p.Column == this).OrderBy(z => z.Order))
{
controlIndex++;
html.Append((control as CanvasControl).ToHtml(controlIndex));
controlWrittenToSection = true;
{
if (!(control is EmptySection))
{
controlIndex++;
html.Append((control as CanvasControl).ToHtml(controlIndex));
controlWrittenToSection = true;
}
}

// if a section does not contain a control we still need to render it, otherwise it get's "lost"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ internal sealed class CanvasControlFlexibleLayoutPositionLG
/// x-postion of the control in the section
/// </summary>
[JsonPropertyName("x")]
public int X
public double X
{
get; set;
}
Expand All @@ -17,7 +17,7 @@ public int X
/// y-postion of the control in the section
/// </summary>
[JsonPropertyName("y")]
public int Y
public double Y
{
get; set;
}
Expand All @@ -26,7 +26,7 @@ public int Y
/// width of the control in the section
/// </summary>
[JsonPropertyName("w")]
public int W
public double W
{
get; set;
}
Expand All @@ -35,7 +35,7 @@ public int W
/// height of the control in the section
/// </summary>
[JsonPropertyName("h")]
public int H
public double H
{
get; set;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -903,10 +903,10 @@ private void SetPropertiesJson(JsonElement parsedJson)
{
FlexibleLayoutPosition = new ControlFlexLayoutPosition
{
XPos = flexibleLayoutPosition.GetProperty("lg").GetProperty("x").GetInt32(),
YPos = flexibleLayoutPosition.GetProperty("lg").GetProperty("y").GetInt32(),
Width = flexibleLayoutPosition.GetProperty("lg").GetProperty("w").GetInt32(),
Height = flexibleLayoutPosition.GetProperty("lg").GetProperty("h").GetInt32()
XPos = flexibleLayoutPosition.GetProperty("lg").GetProperty("x").GetDouble(),
YPos = flexibleLayoutPosition.GetProperty("lg").GetProperty("y").GetDouble(),
Width = flexibleLayoutPosition.GetProperty("lg").GetProperty("w").GetDouble(),
Height = flexibleLayoutPosition.GetProperty("lg").GetProperty("h").GetDouble()
};
if (flexibleLayoutPosition.TryGetProperty("groupId", out JsonElement groupId))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,10 @@ private void SetPropertiesJson(JsonElement parsedJson)
{
FlexibleLayoutPosition = new ControlFlexLayoutPosition
{
XPos = flexibleLayoutPosition.GetProperty("lg").GetProperty("x").GetInt32(),
YPos = flexibleLayoutPosition.GetProperty("lg").GetProperty("y").GetInt32(),
Width = flexibleLayoutPosition.GetProperty("lg").GetProperty("w").GetInt32(),
Height = flexibleLayoutPosition.GetProperty("lg").GetProperty("h").GetInt32()
XPos = flexibleLayoutPosition.GetProperty("lg").GetProperty("x").GetDouble(),
YPos = flexibleLayoutPosition.GetProperty("lg").GetProperty("y").GetDouble(),
Width = flexibleLayoutPosition.GetProperty("lg").GetProperty("w").GetDouble(),
Height = flexibleLayoutPosition.GetProperty("lg").GetProperty("h").GetDouble()
};
if (flexibleLayoutPosition.TryGetProperty("groupId", out JsonElement groupId))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ public class ControlFlexLayoutPosition
/// <summary>
/// Gets or sets the X-coordinate position of the object.
/// </summary>
public int XPos { get; set; }
public double XPos { get; set; }

/// <summary>
/// Gets or sets the vertical position of an object.
/// </summary>
public int YPos { get; set; }
public double YPos { get; set; }

/// <summary>
/// Gets or sets the width of the object, typically measured in pixels.
/// </summary>
public int Width { get; set; }
public double Width { get; set; }

/// <summary>
/// Gets or sets the height of the object.
/// </summary>
public int Height { get; set; }
public double Height { get; set; }

/// <summary>
/// Gets or sets the unique identifier for the web part group associated with the entity.
Expand Down
Loading