From 0f3f13502c326340ed2487c189de11bb24681424 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Fri, 17 Jan 2020 16:01:24 -0500 Subject: [PATCH] Fix hot zones of sub-view cursors... which got broken at 876cd92ed3a1729a4211938ab3c67c649df4cb3e And remove duplicate function --- src/TrackPanel.cpp | 1 + .../wavetrack/ui/WaveTrackView.cpp | 19 ------------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index a3ca23a0a..dd77e35bb 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -178,6 +178,7 @@ END_EVENT_TABLE() /// TODO: Move this function to some other source file for reuse elsewhere. std::unique_ptr MakeCursor( int WXUNUSED(CursorId), const char * const pXpm[36], int HotX, int HotY ) { +#define CURSORS_SIZE32 #ifdef CURSORS_SIZE32 const int HotAdjust =0; #else diff --git a/src/tracks/playabletrack/wavetrack/ui/WaveTrackView.cpp b/src/tracks/playabletrack/wavetrack/ui/WaveTrackView.cpp index 6bc2c6f54..2f92ceac4 100644 --- a/src/tracks/playabletrack/wavetrack/ui/WaveTrackView.cpp +++ b/src/tracks/playabletrack/wavetrack/ui/WaveTrackView.cpp @@ -40,25 +40,6 @@ Paul Licameli split from TrackPanel.cpp namespace { -/// Makes a cursor from an XPM, uses CursorId as a fallback. -/// TODO: Move this function to some other source file for reuse elsewhere. -std::unique_ptr MakeCursor( int WXUNUSED(CursorId), const char * const pXpm[36], int HotX, int HotY ) -{ -#ifdef CURSORS_SIZE32 - const int HotAdjust =0; -#else - const int HotAdjust =8; -#endif - - wxImage Image = wxImage(wxBitmap(pXpm).ConvertToImage()); - Image.SetMaskColour(255,0,0); - Image.SetMask();// Enable mask. - - Image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, HotX-HotAdjust ); - Image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, HotY-HotAdjust ); - return std::make_unique( Image ); -} - using WaveTrackSubViewPtrs = std::vector< std::shared_ptr< WaveTrackSubView > >; // Structure that collects and modifies information on sub-view positions