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

Configurable range for auto scale #136

Merged
merged 5 commits into from
Nov 13, 2023

Conversation

dancek
Copy link
Contributor

@dancek dancek commented Oct 27, 2023

Scales below 1.0 are typically unuseful, so make 1.0 a minimum auto scale by default.

Add configuration options for minimum and maximum auto scale, in case someone actually wants scales under 1.0 or wishes to limit the maximum scale.

Fixes #135.

Scales below 1.0 are typically unuseful, so make 1.0 a minimum auto
scale by default.

Add configuration options for minimum and maximum auto scale, in case
someone actually wants scales under 1.0 or wishes to limit the maximum
scale.
@dancek
Copy link
Contributor Author

dancek commented Oct 27, 2023

I decided to make it configurable while I'm at it, and also add an optional maximum. (If I had access to multiple slightly over 200dpi displays I might well want to limit the maximum to 2.0.)

There's no command-line interface for adjusting the range as that feels like a rare operation.

@alex-courtis
Copy link
Owner

I decided to make it configurable while I'm at it, and also add an optional maximum. (If I had access to multiple slightly over 200dpi displays I might well want to limit the maximum to 2.0.)

Many thanks. We'll likely need max at some stage...

There's no command-line interface for adjusting the range as that feels like a rare operation.

That's fine, it would indeed be rare.

Copy link
Owner

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks, love your work.

Testing:

cli / log

  • shows in -g
  • shows in -y -g

min

  • default - when min not present scale is always set to 1
  • above
  • below
  • bad
  • 0

max

  • default
  • above
  • below
  • 0

other

  • specific scale
  • scaling off
  • auto scaling off
  • change cfg

odd

  • min > max - not quite predictable

shows in -g

info.c.patch.gz assumes 0.0 as "not present".

when min not present scale is always set to 1

Could this be to do with the default values of -1.0? Floats are annoying. Options:

  • use pointers to floats; problematic as you need to deal with allocating / freeing
  • use 0.0f to indicate missing; if the compiler complains about comparing a float to zero we can probably suppress
  • use wl_fixed_t to store the min/max

min > max - not quite predictable

Can we just check and reject this?

src/head.c Outdated Show resolved Hide resolved
doc/CONFIGURATION.md Outdated Show resolved Hide resolved
@dancek
Copy link
Contributor Author

dancek commented Oct 30, 2023

Thanks for a really good review! I'll work on these when I have time (hopefully in a couple of days) and get back to you!

@dancek
Copy link
Contributor Author

dancek commented Nov 8, 2023

cli / log

  • shows in -g

Added.

min

  • default - when min not present scale is always set to 1

Actually this was when max wasn't set, due to accidentally using the default min value as the default max value too. Fixed.

odd

  • min > max - not quite predictable

Fixed by disabling it in this case.


Give it another look with these fixes. I'll be happy to fix any further issues.

Copy link
Owner

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic, all working nicely:

cli / log

  • shows in -g
  • shows in -y -g

min

  • default - when min not present scale is always set to 1 - fixed
  • above
  • below
  • bad
  • 0

max

  • default
  • above
  • below
  • bad
  • 0
  • 0.1 - goes to calculated

min > max

  • uses min

other

  • specific scale
  • scaling off
  • auto scaling off
  • change cfg

@alex-courtis alex-courtis merged commit b0c461f into alex-courtis:master Nov 13, 2023
1 check passed
@alex-courtis
Copy link
Owner

Many thanks for your contribution!

Can you wait for a release? I'd like to get #121 in as well...

@dancek
Copy link
Contributor Author

dancek commented Nov 13, 2023

I'm in no hurry, take your time!

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.

Minimum scale would be useful
2 participants