Skip to content

Commit

Permalink
Merge branch 'develop' into devsecops
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-ivanov committed Jun 28, 2024
2 parents a671955 + 7c4b528 commit 311ac99
Show file tree
Hide file tree
Showing 8 changed files with 754 additions and 266 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ public sealed class LayoutExceptionMessageConstant {

public const String GRID_AUTO_REPEAT_CAN_BE_USED_ONLY_ONCE = "Automatic repetitions in the grid template are allowed only once per template.";

public const String GRID_AUTO_REPEAT_CANNOT_BE_COMBINED_WITH_INDEFINITE_SIZES = "Automatic repetitions in the grid template cannot be combined with intrinsic or flexible sizes.";
public const String GRID_AUTO_REPEAT_CANNOT_BE_COMBINED_WITH_INDEFINITE_SIZES = "Automatic repetitions in the grid template cannot be combined with intrinsic or flexible sizes.";

public const String FLEXIBLE_ARENT_ALLOWED_AS_MINIMUM_IN_MINMAX = "Flexible values aren't allowed as minimum in minmax grid function.";

private LayoutExceptionMessageConstant() {
}
Expand Down
2 changes: 1 addition & 1 deletion itext/itext.layout/itext/layout/renderer/GridSizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private void ResolveGridColumns() {
colsValues.Add(columnAutoWidth);
}
else {
colsValues.Add(new FlexValue(1f));
colsValues.Add(AutoValue.VALUE);
}
}
}
Expand Down
10 changes: 8 additions & 2 deletions itext/itext.layout/itext/layout/renderer/GridTemplateResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,15 @@ private float ProcessValue(TemplateValue value) {
// or as its minimum track sizing function otherwise
// if encountered intrinsic or flexible before, then it doesn't matter what to process
bool currentValue = containsIntrinsicOrFlexible;
float length = ProcessValue(((MinMaxValue)value).GetMax());
MinMaxValue minMaxValue = (MinMaxValue)value;
if (minMaxValue.GetMin().GetType() == TemplateValue.ValueType.FLEX) {
// A future level of CSS Grid spec may allow <flex> minimums, but not now
throw new InvalidOperationException(LayoutExceptionMessageConstant.FLEXIBLE_ARENT_ALLOWED_AS_MINIMUM_IN_MINMAX
);
}
float length = ProcessValue(minMaxValue.GetMax());
if (containsIntrinsicOrFlexible) {
length = ProcessValue(((MinMaxValue)value).GetMin());
length = ProcessValue(minMaxValue.GetMin());
}
containsIntrinsicOrFlexible = currentValue;
result.SetFreeze(false);
Expand Down
1,002 changes: 741 additions & 261 deletions itext/itext.layout/itext/layout/renderer/GridTrackSizer.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion port-hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fc414da4ec172670063a0b874ecf6af0b7629338
79920462383c128f6e228589412e592c76db36fe

0 comments on commit 311ac99

Please sign in to comment.