Skip to content

Commit

Permalink
把Block放進SvgBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
aa89227 committed Aug 12, 2023
1 parent 9bffa01 commit 2672234
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Client/Components/Map.razor
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

<svg width="100%" height="100%" viewBox="0 0 @Data.TotalWidth @Data.TotalHeight" version="1.1"
xmlns="http://www.w3.org/2000/svg">
@foreach (var (row, row_index) in Data.Blocks.Select((item, index) => (row: item, row_index: index)))
@foreach (var (row, row_index) in Data.Blocks.Select((item, index) => (item, index)))
{
@foreach (var (block, index) in row.Select((item, index) => (block: item, index)))
@foreach (var (block, index) in row.Select((item, index) => (item, index)))
{
if (block is null)
{
continue;
}
<SvgBlock Block="@block" Width="@Data.BlockWidth" Height="@Data.BlockHeight" ScaleFactor="@Data.ScaleFactor" />
<SvgBlock Block="@block" Width="@Data.BlockWidth" Height="@Data.BlockHeight" />
}
}
</svg>
4 changes: 2 additions & 2 deletions Client/Components/SvgBlock.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
[Parameter]
public BlazorMap.Block Block { get; set; } = default!;
[Parameter]
public int Width { get; set; } = String.Empty;
public int Width { get; set; } = 0;
[Parameter]
public int Height { get; set; } = String.Empty;
public int Height { get; set; } = 0;

}

0 comments on commit 2672234

Please sign in to comment.