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

Tick label being chopped off #168

Open
mohitmehta317 opened this issue Dec 6, 2019 · 6 comments
Open

Tick label being chopped off #168

mohitmehta317 opened this issue Dec 6, 2019 · 6 comments
Labels
will Try we will try to fix it, but we don't make any promises.

Comments

@mohitmehta317
Copy link

mohitmehta317 commented Dec 6, 2019

When I set tick labels they are being chopped half from bottom and that marker indicator is fine . This is the problem in normal Speedview. Only last and first label have this problem when min degree is 180 and max is 360.

@anastr
Copy link
Owner

anastr commented Dec 6, 2019

If you're using sv_speedometerMode add some sv_cutPadding.
Otherwise you may need to change sv_tickPadding, if it didn't solve the problem please send an image to fix the issue.

@mohitmehta317
Copy link
Author

I tried adding cut padding but it didnt work.
This is the result i am getting:
Screenshot (5)
First and last labels are being chopeed off and Is there a proper way to add strings at these labels??

@mohitmehta317
Copy link
Author

Plus Can we decrease the length of indicator like its width?

@anastr
Copy link
Owner

anastr commented Dec 11, 2019

Simply, ticks are not designed to be in this way.
You need to increase sv_tickPadding to match ticks like this ticks, add some transparent color to the indicator to see the first tick, try to set sv_tickRotation="false" if you like.

indicator

You need to use another indicator or custom indicator.
You can set image indicator with width and height that you want.
Or extend Indicator class and draw your own one, then apply it to speedometer with speedometer.indicator = customIndicator.

@mohitmehta317
Copy link
Author

I have tried increasing tick padding but its still the same and i don't want to turn rotation off because I want labels in this way so help me achieving this.

@anastr
Copy link
Owner

anastr commented Dec 13, 2019

This kind pf adjustment isn't possible by simple extension of speedometer.
Anyway, I will give a quick solution:

mySpeedometer.setOnPrintTickLapel(object: OnPrintTickLabel {
    override fun getTickLabel(tickPosition: Int, tick: Float): CharSequece? {
        return if (tick == 100f) "$tick\t\t" else null
    }
})

@anastr anastr added the will Try we will try to fix it, but we don't make any promises. label Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
will Try we will try to fix it, but we don't make any promises.
Projects
None yet
Development

No branches or pull requests

2 participants