Skip to content

Sliders use integer values instead of floating point values #1772

Open
@InfinityGhost

Description

@InfinityGhost

A large majority of platforms support floating point values, where the abstraction uses integers for the slider value. This severely limits the usefulness of sliders.
This might be this way is because of one or more platforms only supporting integer values for sliders, however that really shouldn't limit every other platform just for that, it could instead just round to nearest integer.

Code that Demonstrates the Problem

// Shortened for brevity
namespace Eto.Forms
{
    [Handler(typeof(IHandler))]
    public class Slider : Control
    {
        public int MaxValue { get; set; }
        public int MinValue { get; set; }
        public int Value { get; set; }
    }
}

Suggested change

// Shortened for brevity
namespace Eto.Forms
{
    [Handler(typeof(IHandler))]
    public class Slider : Control
    {
        public double MaxValue { get; set; }
        public double MinValue { get; set; }
        public double Value { get; set; }
    }
}

Specifications

  • Version: 2.5.4 NuGet package

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions