• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Maths Calculation Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Maths Calculation Problem


  • Subject: Re: Maths Calculation Problem
  • From: "Mark J. Reed" <email@hidden>
  • Date: Fri, 14 Nov 2008 15:59:45 -0500

On Fri, Nov 14, 2008 at 3:29 PM, Simon Topliss <email@hidden> wrote:
Illustrator's co-ordinates are based on postscript co-ordinates. Bottom-left is always the origin.

In that case, while my handler will still function, the nomenclature is backwards.  This one is correct for the Illustrator origin placement.
 

on testIntersection(rect1, rect2)

set {left1, top1, right1, bottom1} to bounds of rect1

set {left2, top2, right2, bottom2} to bounds of rect2

if left1 > right1 then

set {left1, right1} to {right1, left1}

end if

if top1 < bottom1 then

set {top1, bottom1} to {bottom1, top1}

end if

if left2 > right2 then

set {left2, right2} to {right2, left2}

end if

if top2 < bottom2 then

set {top2, bottom2} to {bottom2, top2}

end if

if left1 > right2 then return false

if left2 > right1 then return false

if top1 < bottom2 then return false

if top2 < bottom1 then return false

return true

end testIntersection

 
--
Mark J. Reed <email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Maths Calculation Problem
      • From: Simon Topliss <email@hidden>
References: 
 >Maths Calculation Problem (From: Simon Topliss <email@hidden>)
 >Re: Maths Calculation Problem (From: Skeeve <email@hidden>)
 >Re: Maths Calculation Problem (From: Simon Topliss <email@hidden>)

  • Prev by Date: Re: Maths Calculation Problem
  • Next by Date: Fwd: Maths Calculation Problem
  • Previous by thread: Re: Maths Calculation Problem
  • Next by thread: Re: Maths Calculation Problem
  • Index(es):
    • Date
    • Thread