echoes 0.4.0 → 0.5.0
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/lib/echoes/screen.rb +27 -13
- data/lib/echoes/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d12ae8bf0fab5f169c0d380125005490662167338fb529d6c0a1c3daf725a415
|
|
4
|
+
data.tar.gz: dabea435d3121c0411048313744738e62f759de537f4afd4e4d28dc378188cea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c6306b65e5234b7e35cdb5624ae04b6a0585c5a418bbab22ca8d517a9c8aa928c5e6fdcf0b826d333fa73870275046efd16c4519bccf8d35de7959fba8958d08
|
|
7
|
+
data.tar.gz: 8481081986ffd00775f18a9fd6a5b8a0f3691e0f030c9f6f601b898f1ffc875d8c266b191ca0489e85e39cf6d7117c19843c68dbf9f2a091ec5fa757addcb5f6
|
data/lib/echoes/screen.rb
CHANGED
|
@@ -243,20 +243,20 @@ module Echoes
|
|
|
243
243
|
mc_rows = cells_h && cells_h > 0 ? cells_h : (height / @cell_pixel_height).ceil
|
|
244
244
|
mc_cols = [mc_cols, 1].max
|
|
245
245
|
mc_rows = [mc_rows, 1].max
|
|
246
|
-
return if mc_cols > @cols || mc_rows > @rows
|
|
247
|
-
|
|
248
246
|
if suppress_cursor
|
|
249
247
|
# C=1 (slide-presentation mode): anchor at the current
|
|
250
248
|
# cursor without wrapping or scrolling. A multi-image
|
|
251
249
|
# slideshow would otherwise accumulate a cumulative
|
|
252
250
|
# scroll offset every time an image landed near the
|
|
253
|
-
# bottom, dragging earlier rows off-screen.
|
|
254
|
-
#
|
|
255
|
-
#
|
|
256
|
-
#
|
|
257
|
-
|
|
258
|
-
|
|
251
|
+
# bottom, dragging earlier rows off-screen. Oversize
|
|
252
|
+
# placements are registered at the cursor anyway — only
|
|
253
|
+
# the cells inside the grid get reserved as multicell
|
|
254
|
+
# anchors / continuations; the rest of the image draws
|
|
255
|
+
# via the GUI's blit pass and clips at the pane rect.
|
|
256
|
+
# (Used to bail out entirely on oversize; presentation
|
|
257
|
+
# clients prefer "show what fits" to "show nothing.")
|
|
259
258
|
else
|
|
259
|
+
return if mc_cols > @cols || mc_rows > @rows
|
|
260
260
|
if @cursor.col + mc_cols > @cols
|
|
261
261
|
@cursor.col = 0
|
|
262
262
|
line_feed
|
|
@@ -270,8 +270,19 @@ module Echoes
|
|
|
270
270
|
anchor_row = @cursor.row
|
|
271
271
|
anchor_col = @cursor.col
|
|
272
272
|
|
|
273
|
-
|
|
274
|
-
|
|
273
|
+
# How many cells of the multicell footprint actually land
|
|
274
|
+
# inside the grid. For images that fit, this equals the full
|
|
275
|
+
# mc_cols / mc_rows; oversize C=1 placements get clamped so
|
|
276
|
+
# we never index past `@grid`. The placement entry below
|
|
277
|
+
# still records the full mc_cols × mc_rows so the GUI draws
|
|
278
|
+
# the unclipped image and the pane-rect clip handles the
|
|
279
|
+
# overflowing pixels.
|
|
280
|
+
reservable_cols = [mc_cols, @cols - anchor_col].min
|
|
281
|
+
reservable_rows = [mc_rows, @rows - anchor_row].min
|
|
282
|
+
return if reservable_cols < 1 || reservable_rows < 1
|
|
283
|
+
|
|
284
|
+
reservable_rows.times do |dr|
|
|
285
|
+
reservable_cols.times do |dc|
|
|
275
286
|
erase_multicell_at(anchor_row + dr, anchor_col + dc)
|
|
276
287
|
end
|
|
277
288
|
end
|
|
@@ -286,14 +297,17 @@ module Echoes
|
|
|
286
297
|
# pass off `screen.placements`, not via mc[:sixel]. Keeps
|
|
287
298
|
# the kitty path independent of the cell loop so deletes,
|
|
288
299
|
# scrolls, and font changes affect drawing through one
|
|
289
|
-
# code path.
|
|
300
|
+
# code path. `cols` / `rows` carry the *full* image extent
|
|
301
|
+
# — the GUI uses those for the pixel draw rect — even when
|
|
302
|
+
# only `reservable_*` of those cells actually fit on the
|
|
303
|
+
# grid.
|
|
290
304
|
anchor.multicell = {
|
|
291
305
|
cols: mc_cols, rows: mc_rows, scale: 1,
|
|
292
306
|
frac_n: 0, frac_d: 0, valign: 0, halign: 0,
|
|
293
307
|
}
|
|
294
308
|
|
|
295
|
-
|
|
296
|
-
|
|
309
|
+
reservable_rows.times do |dr|
|
|
310
|
+
reservable_cols.times do |dc|
|
|
297
311
|
next if dr == 0 && dc == 0
|
|
298
312
|
cont = @grid[anchor_row + dr][anchor_col + dc]
|
|
299
313
|
cont.reset!
|
data/lib/echoes/version.rb
CHANGED