From 93b5456c085b577291af5e73a1f7735194d76351 Mon Sep 17 00:00:00 2001 From: James Crook Date: Mon, 24 Apr 2017 23:06:15 +0100 Subject: [PATCH] Rotate pip on vertical slider. --- src/widgets/ASlider.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/widgets/ASlider.cpp b/src/widgets/ASlider.cpp index 4a745f70a..d24d4cdf2 100644 --- a/src/widgets/ASlider.cpp +++ b/src/widgets/ASlider.cpp @@ -629,7 +629,8 @@ void LWSlider::OnPaint(wxDC &dc) } else { - dc.DrawBitmap(*mThumbBitmap, mLeft+thumbOrtho, mTop+thumbPos, true); + // TODO: Don't use pixel-count hack in positioning. + dc.DrawBitmap(*mThumbBitmap, mLeft+thumbOrtho-5, mTop+thumbPos, true); } if (mTipPanel) @@ -653,7 +654,15 @@ void LWSlider::Draw(wxDC & paintDC) // Set up the memory DC wxMemoryDC dc; - mThumbBitmap = std::make_unique(wxBitmap( theTheme.Bitmap( bmpSliderThumb ))); + + if (mOrientation == wxVERTICAL){ + wxImage img(theTheme.Bitmap( bmpSliderThumb ).ConvertToImage() ); + wxImage img2 = img.Rotate90(false); + mThumbBitmap = std::make_unique(wxBitmap( img2)); + } + else + mThumbBitmap = std::make_unique(wxBitmap( theTheme.Bitmap( bmpSliderThumb ))); + // This code draws the (old) slider thumb. #if 0