Section 4

Let's try adjusting the vertical position of the laser beam first. Modify this method on the CellRenderer. We'll make a 1 pixel adjustment on the offset calculation.

renderLaserHorizontalMask: aMaskForm color: aColor
     | cellPosn scaledBeam scale trimmedBeam offset masked |
     cellPosn := self offsetWithinGridForm.
     scale := CellRenderer cellExtent * 6.
     scaledBeam := aMaskForm scaledToSize: scale.
     trimmedBeam := Form extent: (CellRenderer cellExtent x)@(scaledBeam height) depth: scaledBeam depth.
     scaledBeam
         displayOn: trimmedBeam
         at: 0@0
         clippingBox: trimmedBeam boundingBox
         rule: Form paint
         fillColor: nil.
     offset := 0@(5 + (CellRenderer cellExtent y - trimmedBeam height) // 2).
     masked := self maskOffHorizontalOn: trimmedBeam.
     masked
         displayOn: self targetForm
         at: (cellPosn + offset)
         clippingBox: self targetForm boundingBox
         rule: Form oldPaint
         fillColor: aColor

Let's see how that worked.

Index Page Next Page

Copyright © 2007, 2008, 2009, 2010 Stephan B Wessels    stevewessels@me.com