Bug with slider extent.

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Bug with slider extent.

Postby agamemnus » Mon Jul 19, 2010 19:27

A horizontal Falagard slider:

Code: Select all

            // pixel extent of total available area the thumb moves in
            float slideExtent = area.getWidth() - theThumb->getPixelSize().d_width;
            // calculate value represented by current thumb position
            float thumbValue = (theThumb->getXPosition().asAbsolute(w->getPixelSize().d_width) - area.d_left) / (slideExtent / w->getMaxValue());


This does not take into account the thumb track area parameters; the logical and physical extent slider extent and value are the same. This isn't correct.

Code: Select all

        <NamedArea name="ThumbTrackArea">
            <Area>
                <Dim type="LeftEdge"><AbsoluteDim value="3"/></Dim>   
                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
                <Dim type="RightEdge" >
             <UnifiedDim scale="1.0" type="RightEdge">
              <DimOperator op="Subtract"><AbsoluteDim value="3" /></DimOperator>
             </UnifiedDim>
            </Dim>
                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
            </Area>
        </NamedArea>


With this, the minimum slider value is 3. However, the logical minimum value should (theoretically) always be 0.


I don't know how get the values of ThumbTrackArea in code, but this is (I think) the theoretical code: (should also apply to the vertical slider)

Code: Select all

            // pixel extent of total available area the thumb moves in
            float slideExtent = area.getWidth() - theThumb->getPixelSize().d_width - ThumbTrackArea.leftEdgeInPixels() - (area.getWidth() - ThumbTrackArea.rightEdgeInPixels());
            // calculate value represented by current thumb position
            float thumbValue = (theThumb->getXPosition().asAbsolute(w->getPixelSize().d_width) - area.d_left - ThumbTrackArea.leftEdgeInPixels() ) / (slideExtent / w->getMaxValue());

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Bug with slider extent.

Postby agamemnus » Wed Jul 21, 2010 04:23

I did manage to skirt this issue, for now, by removing the offsets from the thumb track area and moving the offsets to the main area, but it does cut off the slider image... barely noticeable in my case, though.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Bug with slider extent.

Postby CrazyEddie » Wed Jul 21, 2010 09:36

I'll check it out, and get back to you, thanks.

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Bug with slider extent.

Postby CrazyEddie » Tue Aug 10, 2010 12:09

Ok, this one is fixed. branches/v0-7 @ r2587.

CE.

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Bug with slider extent.

Postby agamemnus » Wed Aug 11, 2010 06:25

Thanks... I'll try it out, soonish.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 4 guests