Merge remote-tracking branch 'origin/master' into claude/issue-50

# Conflicts:
#	project.cpp
This commit is contained in:
catbot 2026-06-16 16:59:05 +00:00
commit f2f5a770c0
7 changed files with 311 additions and 21 deletions

View file

@ -441,6 +441,36 @@ extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> a
clipImpls.emplace_back("tests/UIClipFlag/main");
clc.GetInterfacesAndImplementations(ifaces, clipImpls);
cfg.tests.push_back(std::move(clipTest));
// Issue #56: InputField_HitTestCursor mapped a click x to a cursor byte
// offset by re-walking the prefix for every boundary (O(n^2) glyph
// metric lookups) over raw byte boundaries. It now delegates to
// Font::NearestCursorByte — one cumulative-advance pass over codepoint
// boundaries. The mapping is pure CPU over a TrueType file, so this test
// drives it directly: no Vulkan device or window. The font is copied
// next to the binary; the test also probes the project-root path.
Test hitTest;
Configuration& hc = hitTest.config;
hc.path = cfg.path;
hc.name = "InputFieldHitTest";
hc.outputName = "InputFieldHitTest";
hc.type = ConfigurationType::Executable;
hc.target = cfg.target;
hc.march = cfg.march;
hc.mtune = cfg.mtune;
hc.debug = cfg.debug;
hc.sysroot = cfg.sysroot;
hc.dependencies = cfg.dependencies;
hc.externalDependencies = cfg.externalDependencies;
hc.compileFlags = cfg.compileFlags;
hc.linkFlags = cfg.linkFlags;
hc.defines = cfg.defines;
hc.cFiles = cfg.cFiles;
hc.files = { fs::path("tests/InputFieldHitTest/font.ttf") };
std::vector<fs::path> hitImpls(impls.begin(), impls.end());
hitImpls.emplace_back("tests/InputFieldHitTest/main");
hc.GetInterfacesAndImplementations(ifaces, hitImpls);
cfg.tests.push_back(std::move(hitTest));
}
return cfg;