mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-24 10:09:32 -06:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
7804cfd223
commit
f3f24ef189
@@ -16,8 +16,8 @@ fn tga(pixels: [[u8; 4]; 4], alpha: bool, rle: bool, top: bool) -> Vec<u8> {
|
||||
bytes[14] = 2;
|
||||
bytes[16] = if alpha { 32 } else { 24 };
|
||||
bytes[17] = if top { 0x20 } else { 0 } | if alpha { 8 } else { 0 };
|
||||
let order = if top { [0, 1, 2, 3] } else { [2, 3, 0, 1] };
|
||||
for row in order.chunks_exact(2) {
|
||||
let rows = if top { [[0, 1], [2, 3]] } else { [[2, 3], [0, 1]] };
|
||||
for row in rows {
|
||||
if rle {
|
||||
assert_eq!(pixels[row[0]], pixels[row[1]]);
|
||||
bytes.push(0x81); // A two-pixel run.
|
||||
|
||||
@@ -498,7 +498,7 @@ mod tests {
|
||||
write(&first, "<fontconfig><dir>/unreadable/fonts</dir></fontconfig>");
|
||||
write(&second, "<fontconfig><dir>/readable/fonts</dir></fontconfig>");
|
||||
let _cleanup = Cleanup { root: root.clone(), file: first.clone(), permissions: std::fs::metadata(&first).unwrap().permissions() };
|
||||
std::fs::set_permissions(&first, std::fs::Permissions::from_mode(0)).unwrap();
|
||||
std::fs::set_permissions(&first, std::fs::Permissions::from_mode(0o000)).unwrap();
|
||||
if std::fs::File::open(&first).is_ok() {
|
||||
eprintln!("skipped: this process can read mode-000 files");
|
||||
return;
|
||||
|
||||
@@ -4649,12 +4649,12 @@ mod tests {
|
||||
#[test]
|
||||
fn the_layer_context_menu_draws_in_the_interface_language() {
|
||||
let caps = LayerMenuCaps { vector: true, text: false };
|
||||
let mut actions = Vec::new();
|
||||
let (mut auto, mut actions) = (crate::automation::Registry::default(), Vec::new());
|
||||
crate::i18n::set_current("zh-hans");
|
||||
let menu = drawn_text(|ui| layer_menu(ui, &[7], caps, &mut actions));
|
||||
let menu = drawn_text(|ui| layer_menu(ui, &[7], caps, (&mut auto, "t"), &mut actions));
|
||||
let effects = drawn_text(|ui| effects_submenu(ui, &[7], &mut |_: &mut egui::Ui, _: &str, _: &str, _: serde_json::Value| {}));
|
||||
crate::i18n::set_current("en");
|
||||
let english = drawn_text(|ui| layer_menu(ui, &[7], caps, &mut actions));
|
||||
let english = drawn_text(|ui| layer_menu(ui, &[7], caps, (&mut auto, "t"), &mut actions));
|
||||
for label in ["新建", "图层设置...", "从矢量图层创建形状", "预合成...", "重复", "拆分图层", "删除"] {
|
||||
assert!(menu.iter().any(|t| t == label), "{label} missing from {menu:?}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user