From 1625a5afb6592e0318231301a32615f9d1e7d2bb Mon Sep 17 00:00:00 2001 From: luah5 <128280019+luah5@users.noreply.github.com> Date: Thu, 13 Apr 2023 11:10:18 +0100 Subject: [PATCH 1/2] fix bug with the images bounds --- CodeEdit/Features/Documents/Views/WorkspaceCodeFileView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeEdit/Features/Documents/Views/WorkspaceCodeFileView.swift b/CodeEdit/Features/Documents/Views/WorkspaceCodeFileView.swift index 0c8323f6cc..f9a13c7792 100644 --- a/CodeEdit/Features/Documents/Views/WorkspaceCodeFileView.swift +++ b/CodeEdit/Features/Documents/Views/WorkspaceCodeFileView.swift @@ -51,7 +51,7 @@ struct WorkspaceCodeFileView: View { OtherFileView(otherFile) } else { OtherFileView(otherFile) - .frame(width: image.size.width, height: image.size.height) + .frame(width: proxy.size.width, height: proxy.size.height) .position(x: proxy.frame(in: .local).midX, y: proxy.frame(in: .local).midY) } } From 1bff68188d4e6559433c03b4ae39962e25033802 Mon Sep 17 00:00:00 2001 From: luah5 <128280019+luah5@users.noreply.github.com> Date: Fri, 14 Apr 2023 10:51:44 +0100 Subject: [PATCH 2/2] respond to @austincondiff's review, fixing a bug --- .../Features/Documents/Views/WorkspaceCodeFileView.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CodeEdit/Features/Documents/Views/WorkspaceCodeFileView.swift b/CodeEdit/Features/Documents/Views/WorkspaceCodeFileView.swift index f9a13c7792..e1c47514e7 100644 --- a/CodeEdit/Features/Documents/Views/WorkspaceCodeFileView.swift +++ b/CodeEdit/Features/Documents/Views/WorkspaceCodeFileView.swift @@ -51,7 +51,10 @@ struct WorkspaceCodeFileView: View { OtherFileView(otherFile) } else { OtherFileView(otherFile) - .frame(width: proxy.size.width, height: proxy.size.height) + .frame( + width: proxy.size.width * (proxy.size.width / image.size.width), + height: proxy.size.height + ) .position(x: proxy.frame(in: .local).midX, y: proxy.frame(in: .local).midY) } }