[Approved] Allow absolute placement of scrollbar + assign width (1 Viewer)

elliottmc

Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    Home Country
    United Kingdom United Kingdom
    Somewhere along with my other fixes to the scrollbars, I ended up with allowing the texture for the scrollbar-background to set the width. With this feature the scrollbarwidth property is not needed, as skinners should just create the background and the handles to the size he wants. These are then scaled and positioned along with the control it belongs to.

    So, I now have this patch you can review for now or for after the Beta (I think it would be wise to wait).

    :sorry: & :D

    Hi,

    I think this needs a new thread - otherwise there is a serious risk of it getting lost.

    Best wishes,

    Mark
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    Hi pilehave,

    small problem with your patch is the HitTest for VerticalScrollbar which relies on Width.

    But I went ahead and fixed scrollbarwidth property. Can you confirm this works as expected?
     

    Attachments

    • !!!SE - guiverticalscrollbar v1.patch
      1.7 KB

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #14
    Hi SE.

    I have attached a patch to put on top on your own patch, that should remove the flickering. As far as I can tell, this should not affect the hit-test, as the width of the scrollbar is ok? But please let me know :)
     

    Attachments

    • pilehave GUIVerticalScrollbar flickerpatch.patch
      1.4 KB

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    That's nice pilehave, thanks! Sorry I havent found time to do any testing and do this myself and reply to PM :) Will try to sort it out after weekend!
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #16
    That's nice pilehave, thanks! Sorry I havent found time to do any testing and do this myself and reply to PM :) Will try to sort it out after weekend!

    No problem at all, I have not been to good recently to focus on MP :oops:

    Have a nice weekend :)
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    Hey pilehave, the last patch could still have problems with HitTest.

    Problem is that this is inside HitTest:

    Code:
    if (x>= XPosition && X < XPosition + [B]Width[/B]

    So <width> skin property is used here to determine whether mouse is inside control horizontally. If skinner sets <width> property same as background image width, it would work but if not, trouble :)

    I will try to reproduce the flickering you're talking about in a bit. I couldn't see it when I first made the patch but we'll see how it goes this time.

    But I suppose we should decide whether to make <width> skin property work on vertical scroll bar OR scrap it and use image sizes as they are + fix HitTest. :)

    Edit: Here is a video I've made while testing my patch. I could not reproduce flickering :( Could it be graphic card/drivers related? But weird thing is that my patch does nothing different than original method, other than calculating initial image Width differently. Once Width is set it's not re-set every rendering cycle, it stays as is - in original method and patched one.
    http://dl.dropbox.com/u/16893016/video-2011-07-11-12-04-48.3gp

    Edit2: I have found out one possible case where scrollbar would be sized differently on each rendering cycle (might be the cause of flickering for you). Attached is the patch which I hope will work correctly for you too :)
     

    Attachments

    • !!!SE - guiverticalscrollbar v2.patch
      1.7 KB

    Users who are viewing this thread

    Top Bottom