From 41dd733ca7123c9ac4bfc6c781697a660e95b052 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Sat, 4 Apr 2026 19:22:04 +0300 Subject: feat: finish ghostty pane backend integration --- vendor/libghostty-vt/src/math.zig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 vendor/libghostty-vt/src/math.zig (limited to 'vendor/libghostty-vt/src/math.zig') diff --git a/vendor/libghostty-vt/src/math.zig b/vendor/libghostty-vt/src/math.zig new file mode 100644 index 00000000..000aa97d --- /dev/null +++ b/vendor/libghostty-vt/src/math.zig @@ -0,0 +1,15 @@ +/// Matrix type +pub const Mat = [4]F32x4; +pub const F32x4 = @Vector(4, f32); + +/// 2D orthographic projection matrix +pub fn ortho2d(left: f32, right: f32, bottom: f32, top: f32) Mat { + const w = right - left; + const h = top - bottom; + return .{ + .{ 2 / w, 0, 0, 0 }, + .{ 0, 2 / h, 0, 0 }, + .{ 0.0, 0.0, -1.0, 0.0 }, + .{ -(right + left) / w, -(top + bottom) / h, 0.0, 1.0 }, + }; +} -- cgit v1.2.3