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

Add customizable guardrails into the edit slide canvas #45

Merged
merged 2 commits into from
Apr 26, 2024

Conversation

kasimos
Copy link
Contributor

@kasimos kasimos commented Apr 23, 2024

This tries to mitigate the need for a completely different canvas size which might have been the intention of #31

I first implemented that, as our event has slightly different resolutions for the projectors and the TVs used as info screens.
This would however result in slides not being really reusable, as they are only saved in the rendered resolution of the last save. So editing it on one screen might end up breaking the other one and vice versa.

So here is an easy way to support multiple resolutions by adding the ability to customize guardrails that will be added into the editing cavas. As a default I added the existing 4:3 ones to not break any existing uses that are not updating their .env file with the new one. So now any slides can be created with the guard lines in mind to have it look pretty on all of our needed resolutions.

Please let me know if I should adjust something. The json based env variable isn't necessarily the best way of handling it, but keeping all config in one file is still the easiest way.

@VibroAxe
Copy link
Contributor

VibroAxe commented Apr 23, 2024

The idea looks good to me, but you've only defined the "default" in the .env.example which WONT be picked up by any existing users. You should define the default value in the Dockerfile - Add the below to the FROM line> https://github.com/kasimos/infoscreen3/blob/b8c7de986e9f23763f9cb11b3226356cc68ed554/Dockerfile#L2

FROM node:current-alpine

#Define default guard rails for 4:3 if nothing defined in .env
ENV GUARDRAILS='[{"line": [240, 0, 240, 1080]}, {"line": [1680, 0, 1680, 1080]}]'

I'd also suggest a comment in the .env.example or in the Readme.md explaining that the default here adds "guard rails" for 4-3 ratios

@kasimos
Copy link
Contributor Author

kasimos commented Apr 24, 2024

Thank you.
I've also added the defaults here: https://github.com/reaby/infoscreen3/pull/45/files#diff-e8e9eea3276b2de9a74fd257902dc74c846f6fc8653bbddf45d738b71201f93dR25
so whenever there isn't any env var for the guardrails present it will default to the 4:3 ones.
I'll add another description to the Readme. Thanks for the suggestion.

I'm also not sure if the env variables are the right place or if the config.js part would be the right place, just like the displays are also only configured in there.

@reaby
Copy link
Owner

reaby commented Apr 24, 2024

hmm it might make sense to deprecate the config.js and just use env variables, as i think most use docker container anyway

@reaby reaby merged commit 66c7718 into reaby:master Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants