Ignore:
Timestamp:
03/15/04 19:51:13 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mgui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mgui/MHexagon.cc

    r3230 r3514  
    112112// All calcutations are running in pixel coordinates
    113113//
    114 Int_t MHexagon::DistancetoPrimitive(Int_t px, Int_t py)
     114Int_t MHexagon::DistancetoPrimitive(Int_t px, Int_t py, Float_t conv)
    115115{
    116116    //
    117117    //  compute the distance of the Point to the center of the Hexagon
    118118    //
    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);
    121121
    122122    const Double_t x = TMath::Abs(px-pxhex);
     
    137137    const Double_t dy = fD/2 * sina;
    138138
    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);
    141141
    142142    const Double_t bx = pxhex-pxborder;
     
    149149    //  here in the first implementation is just circle inside
    150150    //
    151     return distborder < disthex ? (int)(disthex-distborder+1) : 0;
     151    return distborder < disthex ? (int)((disthex-distborder)/conv+1) : 0;
    152152}
    153153
  • trunk/MagicSoft/Mars/mgui/MHexagon.h

    r2231 r3514  
    4949        ;
    5050
    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    }
    5256    virtual Float_t DistanceToPrimitive(Float_t px, Float_t py);
    5357    virtual void  DrawHexagon(Float_t x, Float_t y, Float_t d);
Note: See TracChangeset for help on using the changeset viewer.