Ticket #1837: RectTracking.patch
File RectTracking.patch, 2.5 KB (added by , 14 years ago) |
---|
-
ServerWindow.h
180 180 181 181 DirectWindowInfo* fDirectWindowInfo; 182 182 bool fIsDirectlyAccessing; 183 184 BRect fTrackedRect; 185 bool fIsTrackingRect; 183 186 }; 184 187 185 188 #endif // SERVER_WINDOW_H -
ServerWindow.cpp
171 171 fCurrentDrawingRegionValid(false), 172 172 173 173 fDirectWindowInfo(NULL), 174 fIsDirectlyAccessing(false) 174 fIsDirectlyAccessing(false), 175 176 fIsTrackingRect(false) 175 177 { 176 178 STRACE(("ServerWindow(%s)::ServerWindow()\n", title)); 177 179 … … 2055 2057 2056 2058 case AS_VIEW_BEGIN_RECT_TRACK: 2057 2059 { 2058 DTRACE(("ServerWindow %s: Message AS_VIEW_BEGIN_RECT_TRACK\n", 2059 Title())); 2060 BRect dragRect; 2060 /*DTRACE*/debug_printf("ServerWindow %s: Message AS_VIEW_BEGIN_RECT_TRACK\n", 2061 Title()); 2061 2062 uint32 style; 2062 2063 2063 link.Read<BRect>(& dragRect);2064 link.Read<BRect>(&fTrackedRect); 2064 2065 link.Read<uint32>(&style); 2065 2066 2066 // TODO: implement rect tracking (used sometimes for selecting 2067 // a group of things, also sometimes used to appear to drag 2068 // something, but without real drag message) 2067 fCurrentView->ConvertToScreenForDrawing(&fTrackedRect); 2068 fIsTrackingRect = true; 2069 2069 break; 2070 2070 } 2071 2071 case AS_VIEW_END_RECT_TRACK: 2072 2072 { 2073 DTRACE(("ServerWindow %s: Message AS_VIEW_END_RECT_TRACK\n", 2074 Title())); 2075 // TODO: implement rect tracking 2073 /*DTRACE*/debug_printf("ServerWindow %s: Message AS_VIEW_END_RECT_TRACK\n", 2074 Title()); 2075 //drawingEngine->InvertRect(fTrackedRect); 2076 fIsTrackingRect = false; 2076 2077 break; 2077 2078 } 2078 2079 … … 2835 2836 break; 2836 2837 } 2837 2838 2839 if (fIsTrackingRect) { 2840 debug_printf("Drawing trackrect : %f %f %f %f",fTrackedRect.top, 2841 fTrackedRect.bottom, fTrackedRect.left, fTrackedRect.right); 2842 //drawingEngine->InvertRect(fTrackedRect); 2843 // erase the old rectangle 2844 2845 BPoint where; 2846 int32 buttons; 2847 fDesktop->GetLastMouseState(&where, &buttons); 2848 2849 if (where.x < fTrackedRect.left) { 2850 if (where.y < fTrackedRect.top) 2851 fTrackedRect.SetLeftTop(where); 2852 else 2853 fTrackedRect.SetLeftBottom(where); 2854 } else { 2855 if (where.y < fTrackedRect.top) 2856 fTrackedRect.SetRightTop(where); 2857 else 2858 fTrackedRect.SetRightBottom(where); 2859 } 2860 drawingEngine->StrokeRect(fTrackedRect); 2861 BRegion dirty(fTrackedRect); 2862 fWindow->InvalidateView(fCurrentView, dirty); 2863 } 2864 2838 2865 drawingEngine->UnlockParallelAccess(); 2839 2866 } 2840 2867