Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8076035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:10:42+00:00 2026-06-05T15:10:42+00:00

I am having trouble finding an answer to this. Consider the clipping code below:

  • 0

I am having trouble finding an answer to this. Consider the clipping code below:

           boolean is_ok = mycanvas.clipRect(clip_left, clip_top, clip_right+1, clip_bottom+1);
       mycanvas.getClipBounds(clipRect);
       if (!is_ok ||
               clipRect.left != clip_left ||
               clipRect.top != clip_top ||
               clipRect.right != clip_right+1 ||
               clipRect.bottom != clip_bottom+1)
       {
           Log.i("DEBUG", "setClipping failed");
       }

When the clip bounds are returned they don’t match what was just set. For example if clip_left, clip_top, clip_right, clip_bottom are (100,50,109, 59) then I would expect the clipping bounds to be (100, 50, 110, 60) given the code above. It isn’t. getClipBounds() returns (100, 51, 110, 60).

Why is top = 51 when I just set it to 50? There’s something under the hood I don’t understand yet.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:10:44+00:00Added an answer on June 5, 2026 at 3:10 pm

    OK, I need to read more clearly before asking questions. In case anyone is interested I’ll answer this myself:

    When setting a new clipRect, I assumed it would replace the prior clipping. This is NOT so. Instead it creates an intersection with the previous clipping. From the Android Developers page:

    clipRect(float left, float top, float right, float bottom)

    Intersect the current clip with the specified rectangle, which is
    expressed in local coordinates.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble finding a clear answer to this question so I thought I'd
For some reason I'm having trouble finding an answer to this, but it's a
I am uploading files and having trouble finding an answer to this question. Some
I'm having some hard trouble finding the answer for this Is there anyway to
I'm having trouble finding an answer for this problem. Most similar posts lean seem
I'm having a bit of trouble finding an answer on this: Using Django forms,
Ok, I'm having trouble finding an answer to this that isn't just use JSON
I seem to be having some trouble finding the answer to this one. My
This seems like a simple question, but I am having trouble finding the answer.
I'm having trouble finding a good answer to this. For some reason I thought

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.