Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

EditorGUI.IntSlider Max Value Issues

Discussion in 'Immediate Mode GUI (IMGUI)' started by Kyle_WG, Mar 19, 2014.

  1. Kyle_WG

    Kyle_WG

    Joined:
    Feb 12, 2013
    Posts:
    8
    Hey, I can't find why the max value used in the slider overflows at 2147483584 rather than 2147483647.

    The difference is 63 (which does seem important) but I want to make sure I am not missing out on something that I haven't seen.

    Code (csharp):
    1. randomSeed = EditorGUILayout.IntSlider("Seed", randomSeed, 1, Int32.MaxValue-1);
    When I drag the slider over 2147483583 it resets to 1.

    Any help is greatly appreciated, cheers.
     
  2. yls

    yls

    Joined:
    Apr 13, 2012
    Posts:
    195
    Hi

    With such a big range, Isn't it a resolution issue ?
     
  3. Kyle_WG

    Kyle_WG

    Joined:
    Feb 12, 2013
    Posts:
    8
    He yls, I don't reckon it should be.. unless there's some internal calculation that messes with the large but I don't see why it should do that. There's no casting or division at all either; standard 32 bit integer values.

    The range that I can get is large enough anyway but curious to find out why it does this.