实际尺寸之间转换

This commit is contained in:
艾竹
2023-02-11 22:20:24 +08:00
parent 86082cb788
commit 59bfed341d
14 changed files with 487 additions and 265 deletions

View File

@@ -53,10 +53,9 @@ namespace AIStudio.Wpf.DiagramDesigner
if (designerbase is ConnectorInfoItemBase designer)
{
ConnectorWidth = designer.ConnectorWidth;
ConnectorHeight = designer.ConnectorHeight;
PhysicalConnectorWidth = designer.PhysicalConnectorWidth;
PhysicalConnectorHeight = designer.PhysicalConnectorHeight;
Orientation = designer.Orientation;
ConnectorValue = designer.ConnectorValue;
}
}
@@ -87,44 +86,61 @@ namespace AIStudio.Wpf.DiagramDesigner
}
}
private double connectorWidth = 8;
private double _connectorWidth = 8;
public double ConnectorWidth
{
get
{
return connectorWidth;
return _connectorWidth;
}
set
{
connectorWidth = value;
if (SetProperty(ref _connectorWidth, value))
{
RaisePropertyChanged(nameof(PhysicalConnectorWidth));
}
}
}
private double connectorHeight = 8;
private double _connectorHeight = 8;
public double ConnectorHeight
{
get
{
return connectorHeight;
return _connectorHeight;
}
set
{
connectorHeight = value;
if (SetProperty(ref _connectorHeight, value))
{
RaisePropertyChanged(nameof(PhysicalConnectorHeight));
}
}
}
public double _connectorValue;
public double ConnectorValue
public double PhysicalConnectorWidth
{
get
{
return _connectorValue;
return ConnectorWidth * (Root?.ScreenScale ?? 1d);
}
set
{
SetProperty(ref _connectorValue, value);
ConnectorWidth = value / (Root?.ScreenScale ?? 1d);
}
}
public double PhysicalConnectorHeight
{
get
{
return ConnectorHeight * (Root?.ScreenScale ?? 1d);
}
set
{
ConnectorHeight = value / (Root?.ScreenScale ?? 1d);
}
}
#endregion
}
}

View File

@@ -36,10 +36,24 @@ namespace AIStudio.Wpf.DiagramDesigner
if (designerbase is LogicalConnectorInfoItem designer)
{
ConnectorValue = designer.ConnectorValue;
ValueTypePoint = designer.ValueTypePoint;
}
}
public double _connectorValue;
public double ConnectorValue
{
get
{
return _connectorValue;
}
set
{
SetProperty(ref _connectorValue, value);
}
}
public ValueTypePoint _valueTypePoint;
public ValueTypePoint ValueTypePoint
{