Skip to content

Commit

Permalink
サーフェスビューワv3の判定領域計算でゼロオリジン関係が考慮できてないのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadelab committed Jan 29, 2024
1 parent 1619528 commit faf0a71
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Satolist2/Control/RuntimeBasedSurfaceViewer.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,14 @@ public enum CollisionType
public string DockingContentId => ContentId;

//サーフェスの基準サイズ
private System.Drawing.Size SelectedSurfaceBaseSize
public System.Drawing.Size SelectedSurfaceBaseSize
{
get
{
if (selectedSurface == null)
return default;
var windowItem = windowItems[selectedSurface.Scope];
return windowItem.CurrentSurfaceSizeData.ZeroOriginSize;
return windowItem.CurrentSurfaceSizeData?.ZeroOriginSize ?? default;
}
}

Expand Down Expand Up @@ -185,6 +187,7 @@ public RuntimeBasedSurfaceViewerItemViewModel SelectedSurface
{
selectedSurface = value;
NotifyChangeSurface();
NotifyChanged(nameof(SelectedSurfaceBaseSize));
}
}
}
Expand Down Expand Up @@ -772,6 +775,9 @@ private void OnMetadataGenerated(int msg, IntPtr wparam, IntPtr lparam)
{
var sizeData = new SurfaceSizeData(surfaceBitmap.Size, surfaceZeroBitmap.Size);
windowItems[surface.Scope].SetSurfaceImageSize(generatingSurfaceId, sizeData);

//ちょっと不自然だがここで交信かけてやる
NotifyChanged(nameof(SelectedSurfaceBaseSize));
}
}

Expand Down

0 comments on commit faf0a71

Please sign in to comment.