Changeset 3514 for trunk/MagicSoft/Mars/mgui
- Timestamp:
- 03/15/04 19:51:13 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mgui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mgui/MHexagon.cc
r3230 r3514 112 112 // All calcutations are running in pixel coordinates 113 113 // 114 Int_t MHexagon::DistancetoPrimitive(Int_t px, Int_t py )114 Int_t MHexagon::DistancetoPrimitive(Int_t px, Int_t py, Float_t conv) 115 115 { 116 116 // 117 117 // compute the distance of the Point to the center of the Hexagon 118 118 // 119 const Int_t pxhex = gPad->XtoAbsPixel(fX );120 const Int_t pyhex = gPad->YtoAbsPixel(fY );119 const Int_t pxhex = gPad->XtoAbsPixel(fX*conv); 120 const Int_t pyhex = gPad->YtoAbsPixel(fY*conv); 121 121 122 122 const Double_t x = TMath::Abs(px-pxhex); … … 137 137 const Double_t dy = fD/2 * sina; 138 138 139 const Int_t pxborder = gPad->XtoAbsPixel( fX + dx);140 const Int_t pyborder = gPad->YtoAbsPixel( fY + dy);139 const Int_t pxborder = gPad->XtoAbsPixel((fX + dx)*conv); 140 const Int_t pyborder = gPad->YtoAbsPixel((fY + dy)*conv); 141 141 142 142 const Double_t bx = pxhex-pxborder; … … 149 149 // here in the first implementation is just circle inside 150 150 // 151 return distborder < disthex ? (int)( disthex-distborder+1) : 0;151 return distborder < disthex ? (int)((disthex-distborder)/conv+1) : 0; 152 152 } 153 153 -
trunk/MagicSoft/Mars/mgui/MHexagon.h
r2231 r3514 49 49 ; 50 50 51 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); 51 Int_t DistancetoPrimitive(Int_t px, Int_t py, Float_t conv); 52 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) 53 { 54 return DistancetoPrimitive(px, py, 1); 55 } 52 56 virtual Float_t DistanceToPrimitive(Float_t px, Float_t py); 53 57 virtual void DrawHexagon(Float_t x, Float_t y, Float_t d);
Note:
See TracChangeset
for help on using the changeset viewer.