Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

Element Rotation and Knob Widget #841

Open
frink opened this issue May 15, 2019 · 2 comments
Open

Element Rotation and Knob Widget #841

frink opened this issue May 15, 2019 · 2 comments

Comments

@frink
Copy link

frink commented May 15, 2019

The rotation of objects should be allowed to create more complex layouts. The first example that comes to mind is a 2d charts where the headers are clickable buttons tilted at a 45 degree angle. Pie charts and dials could also be easily built from rotated components. Another case of rotation is rotary knobs. Just adding rotation should allow most of these more complex widgets to easily be built...

@frink frink changed the title [FR] Add Element Rotation and Knobs Element Rotation and Knob Widget May 15, 2019
@dumblob
Copy link
Contributor

dumblob commented May 27, 2019

No, there is no support for rotation and I'm also not sure whether there should be one as supporting rotation essentially means implementing support for (all) affine transformations, which might unnecessarily complicate API.

Nuklear though makes it easy to implement your own variant of the current widget which could among other things support rotation in the desired way.

I'm open though to any API proposals and implementations as I think it might actually be useful.

@frink
Copy link
Author

frink commented May 28, 2019

@dumblob I'll have to go back over the API before I propose the syntax. BUt here is a quick overview of how I'd expect a knob to work:

  • Most knobs are drag started Left or Down for Counterclockwise and Up or Right for Clockwise.
  • Knobs should have the following attributes:
    • Start Angle (Required)
    • End Angle (If null implies continuous rotation)
    • Rotation Value (Initial value of rotation or 0 if null)
    • Detent Steps (number of detents in the knob or null for continuous)
    • Radius Size (How big the knob is...)

I believe this would satisfy all cases including Continuous Knobs, Partial Rotation, Detented Potentiometers, Needle Meters (180deg)...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants