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 changed default size of the touchscreen formspec #32

Open
S-S-X opened this issue Jan 30, 2022 · 2 comments
Open

Fix changed default size of the touchscreen formspec #32

S-S-X opened this issue Jan 30, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@S-S-X
Copy link
Member

S-S-X commented Jan 30, 2022

The default size of the formspec changed from width 13 and height 10 to width 10 and height 8

I did some testing, and this is actually a bug with the old touchscreens when real coordinates are enabled. They have always been 10 by 8, but because the real_coordinates element was not placed immediately after the size element, it caused the formspec to be bigger than it was supposed to be.

See here, the size before and after the rewrite is the same:

local fs = "size[10,8]"..

digistuff/touchscreen.lua

Lines 121 to 122 in a49e4dd

local width = tonumber(meta:get_string("width")) or 10
local height = tonumber(meta:get_string("height")) or 8

Originally posted by @OgelGames in #25 (comment)

This should be fixed (it is irrelevant if it was "bug" in original, behavior can probably be restored without reintroducing invalid use of real_coordinates).

@S-S-X S-S-X added the bug Something isn't working label Jan 30, 2022
@OgelGames
Copy link
Contributor

I don't think this should be "fixed", as doing so is effectively reintroducing the bug. Formspecs should remain the same size whether real coordinates are used or not. (and I mean the set size, not the visual size)

Also there is a simple fix for it:

Can be fixed ingame by adding: {command = "set", width = 13, height = 10}

It might be good to mention it in the documentation though.

@S-S-X
Copy link
Member Author

S-S-X commented Jan 31, 2022

as doing so is effectively reintroducing the bug

I've probably misunderstood original issue, how exactly changing default size to follow original behavior reintroduces bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants