Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions crates/aether-core/src/char_width.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@
/// - 0:组合标记、控制字符、格式控制符(零宽度)
/// - 1:窄字符(拉丁、希腊、西里尔等)
/// - 2:宽字符(CJK、全角、Emoji)
/// - 4:Tab 字符(制表符占 4 格)
pub fn char_width(c: char) -> usize {
let cp = c as u32;

// Tab 字符特殊处理:占 4 格
if cp == 0x09 {
return 4;
}

// ===== 零宽度字符 =====
if is_zero_width(cp) {
return 0;
Expand Down
2 changes: 1 addition & 1 deletion crates/aether-render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ aether-core = { path = "../aether-core" }
rustc-hash = "2"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
windows = { version = "0.58", features = ["Win32_Graphics_Direct2D", "Win32_Graphics_Direct2D_Common", "Win32_Graphics_Dxgi", "Win32_Graphics_Dxgi_Common", "Win32_Graphics_DirectWrite", "Win32_Graphics_Gdi", "Win32_Foundation", "Foundation_Numerics", "Win32_System_Performance", "Win32_System_SystemInformation", "Win32_UI_HiDpi"] }
windows = { version = "0.58", features = ["Win32_Graphics_Direct2D", "Win32_Graphics_Direct2D_Common", "Win32_Graphics_Dxgi", "Win32_Graphics_Dxgi_Common", "Win32_Graphics_DirectWrite", "Win32_Graphics_Gdi", "Win32_Foundation", "Foundation_Numerics", "Win32_System_Performance", "Win32_System_SystemInformation", "Win32_UI_HiDpi", "Win32_Graphics_Direct3D11", "Win32_Graphics_Direct3D", "Win32_Graphics_Direct3D_Fxc", "Win32_Graphics_Hlsl"] }
12 changes: 11 additions & 1 deletion crates/aether-render/src/d2d/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,17 @@ impl RenderTarget {
},
geometricMask: ManuallyDrop::new(Some(group_as_geometry)),
maskAntialiasMode: windows::Win32::Graphics::Direct2D::D2D1_ANTIALIAS_MODE_ALIASED,
maskTransform: Matrix3x2::default(),
// 单位矩阵:保持掩码几何在原始坐标空间。
// 注意:Matrix3x2::default() 为全零矩阵(退化变换),会把掩码塌缩为单点,
// 导致裁剪帧内所有绘制被丢弃(多矩形脏矩形重绘不生效)。
maskTransform: Matrix3x2 {
M11: 1.0,
M12: 0.0,
M21: 0.0,
M22: 1.0,
M31: 0.0,
M32: 0.0,
},
opacity: 1.0,
opacityBrush: ManuallyDrop::new(None),
layerOptions: windows::Win32::Graphics::Direct2D::D2D1_LAYER_OPTIONS_NONE,
Expand Down
Loading
Loading