zaniah 0.5.1 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/zaniah/process_wire.rb +1 -1
- data/lib/zaniah/text_system/atlas_cache.rb +1 -1
- data/lib/zaniah/text_system/paragraph.rb +4 -3
- data/lib/zaniah/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7ece04baf122d918de7ded4ab1ef943d1af3e50d85e23f9b496dafa77d8da3d7
|
|
4
|
+
data.tar.gz: 34777228a8ea17ea82cda2edcf76d74f4bec7cc3b6fca6728e01082caba8c43a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e9bf5c470a0c4f08c289a22472ae5e5df75c26d51cc9fb45d4896057d06f2bf727d72a409c9f5696e87ae38da3a3ecb32d993bf71c33d24d9c234aa3091e4ad
|
|
7
|
+
data.tar.gz: 52ceec0f227e76e2c8096bb5ec9224a3ec314da00d2e6513314ab7294eb406023c73967bc631d4dadf9aedd2931adb7cc38aaebef9f2b5f60e176b323e8075ae
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.5.3 — 2026-09-17
|
|
6
|
+
|
|
7
|
+
- Restore Ruby 4.0/json 3 compatibility for process messages and atlas caches while keeping JSON object additions disabled.
|
|
8
|
+
|
|
9
|
+
## 0.5.2 — 2026-09-16
|
|
10
|
+
|
|
11
|
+
- Preserve insertion order for inline overlays that share an offset and alignment.
|
|
12
|
+
|
|
5
13
|
## 0.5.1 — 2026-09-16
|
|
6
14
|
|
|
7
15
|
- Let lazy tree views accept externally loaded children and invalidate cached subtrees without blocking the UI thread.
|
data/lib/zaniah/process_wire.rb
CHANGED
|
@@ -74,7 +74,7 @@ module Zaniah
|
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
def self.decode_payload(body)
|
|
77
|
-
validate_payload(JSON.parse(body, max_nesting: MAX_DEPTH
|
|
77
|
+
validate_payload(JSON.parse(body, max_nesting: MAX_DEPTH), freeze: true)
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
def self.error_message(error)
|
|
@@ -72,7 +72,7 @@ module Zaniah
|
|
|
72
72
|
json, pixels = file.read(json_size), file.read(pixel_size)
|
|
73
73
|
return unless json&.bytesize == json_size && pixels&.bytesize == pixel_size
|
|
74
74
|
return unless Digest::SHA256.new.update(json).update(pixels).digest == header.byteslice(20, 32)
|
|
75
|
-
metadata = JSON.parse(json, max_nesting: 8
|
|
75
|
+
metadata = JSON.parse(json, max_nesting: 8)
|
|
76
76
|
return unless valid_metadata?(metadata, key: key, width: width, height: height, format: format)
|
|
77
77
|
return unless pixels.bytesize == width * metadata["rows"] * (format == :r8 ? 1 : 4)
|
|
78
78
|
texture = GPU::Texture.new(width, height, format: format)
|
|
@@ -73,14 +73,15 @@ module Zaniah
|
|
|
73
73
|
|
|
74
74
|
def validate_overlays(overlays)
|
|
75
75
|
raise ArgumentError, "inline overlays must be an array" unless overlays.is_a?(Array)
|
|
76
|
-
overlays.map do |overlay|
|
|
76
|
+
overlays.map.with_index do |overlay, index|
|
|
77
77
|
unless overlay.is_a?(InlineOverlay) && overlay.offset.is_a?(Integer) && overlay.offset.between?(0, @text.bytesize) &&
|
|
78
78
|
Unicode.grapheme_boundary?(@text, overlay.offset) && %i[before after].include?(overlay.align) &&
|
|
79
79
|
[overlay.width, overlay.height].all? { |value| value.is_a?(Numeric) && value.finite? && !value.negative? }
|
|
80
80
|
raise ArgumentError, "invalid inline overlay"
|
|
81
81
|
end
|
|
82
|
-
overlay
|
|
83
|
-
end.sort_by { |overlay| [overlay.offset, overlay.align == :before ? 0 : 1] }
|
|
82
|
+
[overlay, index]
|
|
83
|
+
end.sort_by { |overlay, index| [overlay.offset, overlay.align == :before ? 0 : 1, index] }
|
|
84
|
+
.map!(&:first).freeze
|
|
84
85
|
end
|
|
85
86
|
|
|
86
87
|
def overlays_for(first, finish)
|
data/lib/zaniah/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zaniah
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yudai Takada
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: alhena
|