cloudhead / rx

👾 Modern and minimalist pixel editor
https://discord.gg/xHggPjfsS9
GNU General Public License v3.0
3.09k stars 109 forks source link

Specifying a file to open at the command line forces zoom to 100% #74

Open ssokolow opened 4 years ago

ssokolow commented 4 years ago

I'm running a copy of rx installed with cargo install --git https://github.com/cloudhead/rx --tag v0.4.0 on Kubuntu Linux 16.04 LTS (64-bit) and I observe the following undesirable behaviour.

With the following in .rxrc in the current directory...

-- Set Cavernas tile size
f/resize 8 8
zoom 8.0

-- Work around the apparent inability to display "actual in-game size" and
-- "preferred editing size" simultaneously
map / :zoom 4.0
map m :zoom 16.0

-- Remap Enter to clone the last frame rather than inserting a blank one
map <return> :f/clone

-- Set Cavernas palette
p/clear
p/add #3e3d4c
p/add #5a5a63
p/add #847f7f
p/add #bcb19f
p/add #21263f
p/add #394071
p/add #4063b2
p/add #efe7ce
p/add #3a5339
p/add #6b7b39
p/add #84ad42
p/add #c0461f
p/add #6c4f40
p/add #a5845a
p/add #cead73
p/add #673347
  1. Running rx works as expected
  2. Running rx player.png obeys every command in .rxrc except the zoom 8.0 (whether or not player.png exists).

(Which suggests to me that specifying a file on the command line is causing it do something equivalent to injecting a zoom 1.0 after evaluating .rxrc.)

cloudhead commented 4 years ago

Yeah, the reason for this is that zoom is a command that operates on the currently active view, not a global setting. We could add a view/zoom setting for that purpose that would be read when editing new views.

ssokolow commented 4 years ago

As long as it's clearly documented, that sounds like a good way to go about it.