mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
实际尺寸之间转换
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user