File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ v . # build
2424mrpenishot # all outputs
2525mrpenishot -c # including cursor
2626mrpenishot out.png # output to file
27+ mrpenishot -o " DP-1" # geometry of output
2728mrpenishot -f jxl # output to jxl
2829mrpenishot -g " 100,200 300x400" # geometry
2930mrpenishot -g " $( slurp) " # geometry from slurp
Original file line number Diff line number Diff line change @@ -396,6 +396,17 @@ fn main() {
396396 }
397397 }
398398
399+ // grab geometry from output name
400+ if output_name != '' {
401+ matching := state.outputs.filter (fn [output_name] (o Output) bool {
402+ return o.name == output_name
403+ })
404+ if matching.len != 1 {
405+ panic ('ERROR: unrecognized output name `${output_name} `' )
406+ }
407+ geometry = matching[0 ].logical_geometry
408+ }
409+
399410 mut scale := 1.0
400411 if toplevel_identifier != '' {
401412 // capture toplevel
You can’t perform that action at this time.
0 commit comments