port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using System;
namespace Intromat.Nodes.Code
{
public class IntLiteralValue : LiteralValueBase<int>
{
public int EvaluateDimension()
{
var relativeDimension = RelativeSource switch
{
ERelativeSource.Parent => 1 << ParentValue,
ERelativeSource.Input => InputValue,
_ => 1
};
var result = Value switch
{
< 0 => relativeDimension >> -Value,
> 0 => relativeDimension << Value,
_ => relativeDimension
};
return Math.Max(1, Math.Min(8192, result));
}
}
}