Use x/y offset in calculation
Merge pull request #244 from isage/opacity-fix

Use x/y offset in calculation