Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Check if bounding box is within another bounding box

Community Beginner ,
Aug 08, 2016 Aug 08, 2016

Using the PDETextIsAtRect function I discovered that if returns element that are not part of bounding box. So I wanted to know if I have two bounding boxes is it possible to check if the bounding box of one element can be found within the bounding bx of another element.

TOPICS
Acrobat SDK and JavaScript
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Aug 09, 2016 Aug 09, 2016

That's not valid C. Well, clearly it compiles but it very much doesn't do what you think. You cannot use the form a <= b <= c, only compare TWO things, not three.

Translate
Adobe Employee ,
Aug 08, 2016 Aug 08, 2016

Just use standard polygon containment to determine that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 08, 2016 Aug 08, 2016

Can you explain more? I'm still a little confused. Do you mean that I can use the x y coordinated?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 09, 2016 Aug 09, 2016

So I tried to use the following if statement with newRect being the ASFixedRect  element I'm checking to see is within boundingRect, however I am getting addition text run

if((boundingRect.left <= newRect.left <= boundingRect.right) && (boundingRect.left <= newRect.right <= boundingRect.right) && (boundingRect.bottom <= newRect.bottom <= boundingRect.top) && (boundingRect.bottom <= newRect.top <= boundingRect.top))

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 09, 2016 Aug 09, 2016
LATEST

That's not valid C. Well, clearly it compiles but it very much doesn't do what you think. You cannot use the form a <= b <= c, only compare TWO things, not three.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines