mirror of
https://github.com/egmont11/NetworkDiagram.git
synced 2026-07-24 07:09:43 +02:00
Fixed up the text creation placement
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
@@ -42,8 +42,8 @@
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
|
||||
<ComboBox x:Name="LangCombo" Width="70" Height="30" SelectionChanged="LangCombo_SelectionChanged">
|
||||
<ComboBoxItem Tag="en">EN</ComboBoxItem>
|
||||
<ComboBoxItem Tag="cs" IsSelected="True">CZ</ComboBoxItem>
|
||||
<ComboBoxItem Tag="en" IsSelected="True">EN</ComboBoxItem>
|
||||
<ComboBoxItem Tag="cs">CZ</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
|
||||
@@ -607,7 +607,14 @@ namespace NetworkDiagram
|
||||
|
||||
private void WireTool_Click(object sender, RoutedEventArgs e) => _activeTool = ConnectionType.Wire;
|
||||
private void WifiTool_Click(object sender, RoutedEventArgs e) => _activeTool = ConnectionType.Wifi;
|
||||
private void AddText_Click(object sender, RoutedEventArgs e) => AddDeviceToCanvas(new DeviceTemplate { Name = "Note", IconPath = "" }, 100, 100);
|
||||
private void AddText_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// Center of the current viewport in canvas coordinates
|
||||
double centerX = (CanvasViewport.ActualWidth / 2 - CanvasTranslate.X) / CanvasScale.ScaleX;
|
||||
double centerY = (CanvasViewport.ActualHeight / 2 - CanvasTranslate.Y) / CanvasScale.ScaleY;
|
||||
|
||||
AddDeviceToCanvas(new DeviceTemplate { Name = "Note", IconPath = "" }, centerX, centerY);
|
||||
}
|
||||
|
||||
private void ExportPng_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
@@ -54,5 +54,9 @@
|
||||
{
|
||||
"Name": "Wireless Router",
|
||||
"IconPath": "Assets/wireless router.jpg"
|
||||
},
|
||||
{
|
||||
"Name": "Video camera",
|
||||
"IconPath": "Assets/video camera.jpg"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user