Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Bounding Box Calculation #859

Merged
merged 2 commits into from
Jan 17, 2025
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
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[target.wasm32-wasi]
[target.wasm32-wasip1]
runner = "wasmtime run --dir ."

[target.x86_64-pc-windows-msvc]
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
pull_request:
push:
branches:
- 'master'
- "master"
tags:
- '*'
- "*"

jobs:
build:
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
# WebAssembly
- WebAssembly Unknown
- WebAssembly Web
- WebAssembly WASI
- WebAssembly WASI 0.1

# Windows
- Windows aarch64
Expand Down Expand Up @@ -237,8 +237,8 @@ jobs:
install_target: true
features: "--features wasm-web"

- label: WebAssembly WASI
target: wasm32-wasi
- label: WebAssembly WASI 0.1
target: wasm32-wasip1
auto_splitting: skip
cross: skip
dylib: skip
Expand Down Expand Up @@ -706,7 +706,7 @@ jobs:
- name: Use Node 10
uses: actions/setup-node@v1
with:
node-version: '10.x'
node-version: "10.x"
- name: Build TypeScript documentation
run: |
cd capi/js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ main() {
wasm32-unknown-unknown)
$cargo rustc -p livesplit-core-capi --crate-type cdylib --target $TARGET $release_flag $FEATURES
;;
wasm32-wasi)
wasm32-wasip1)
$cargo rustc -p livesplit-core-capi --crate-type cdylib --target $TARGET $release_flag $FEATURES
;;
*)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main() {
features="$features,software-rendering"
fi

if [ "$TARGET" = "wasm32-wasi" ]; then
if [ "$TARGET" = "wasm32-wasip1" ]; then
curl https://wasmtime.dev/install.sh -sSf | bash
export PATH="$HOME/.wasmtime/bin:$PATH"
else
Expand Down
4 changes: 2 additions & 2 deletions crates/livesplit-auto-splitting/tests/sandboxing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn compile(crate_name: &str) -> anyhow::Result<AutoSplitter<DummyTimer>> {
.current_dir(&path)
.arg("build")
.arg("--target")
.arg("wasm32-wasi")
.arg("wasm32-wasip1")
.stdin(Stdio::null())
.stdout(Stdio::null())
.output()
Expand All @@ -49,7 +49,7 @@ fn compile(crate_name: &str) -> anyhow::Result<AutoSplitter<DummyTimer>> {
}

path.push("target");
path.push("wasm32-wasi");
path.push("wasm32-wasip1");
path.push("debug");
let wasm_path = fs::read_dir(path)
.unwrap()
Expand Down
5 changes: 4 additions & 1 deletion src/rendering/software.rs
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,10 @@ fn calculate_bounds(layer: &[Entity<SkiaPath, SkiaImage, SkiaLabel>]) -> [f32; 2
Entity::Label(label, _, transform) => {
for glyph in label.read().unwrap().glyphs() {
if let Some(path) = &glyph.path {
let transform = transform.pre_translate(glyph.x, glyph.y);
let transform = transform
.pre_translate(glyph.x, glyph.y)
.pre_scale(glyph.scale, glyph.scale);

let bounds = path.bounds();
for y in [bounds.top(), bounds.bottom()] {
let transformed_y = transform.transform_y(y);
Expand Down
Loading