Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

canvasMode(BLEED/MARGIN/FACING_BLEEDS/FACING_MARGINS) fix for bounds() #256

Merged
merged 7 commits into from
Apr 4, 2018

Conversation

ffd8
Copy link
Member

@ffd8 ffd8 commented Mar 8, 2018

The bounds was ignoring our canvasMode() - a potential bug since a long time that was occasionally run into.

ffd8 and others added 4 commits March 8, 2018 02:54
works so long as rectMode(CENTER) is on... means there may be an issue in the matrix?
forgot to edit this...
@ff6347
Copy link
Member

ff6347 commented Apr 2, 2018

What about this PR? Is it still valid? Should get a review

@ff6347
Copy link
Member

ff6347 commented Apr 2, 2018

@basiljs

@ffd8
Copy link
Member Author

ffd8 commented Apr 2, 2018

I believe @trych ended up null+voiding this request when he did an overhaul recently on bounds? (canvasMode is still broken in current develop branch). I think his branch still needs to be added.. so I leave it up to him if this should be merged or not.

@trych
Copy link
Contributor

trych commented Apr 2, 2018

This is still valid, but needs some re-work, as we now have global private variables to keep track of the x and y origin (as determined by the currently set canvas mode and page). Will have a look at this soon.

@trych
Copy link
Contributor

trych commented Apr 4, 2018

Ok, I implemented currOriginX and currOriginY into the function, so it is more reliable now. Note that this does not fix the issues described in #166 yet, fixing those will require a major rewrite of the function and can hopefully done some time in the future.

Will merge.

@trych trych merged commit 5fd5399 into b-less Apr 4, 2018
@trych trych deleted the b-less-bounds branch April 4, 2018 08:46
@ffd8
Copy link
Member Author

ffd8 commented Nov 12, 2018

We've discovered that canvasMode(MARGIN) (and FACING_MARGINS) still messes up the bounds().
Luckily no problems with normal/facing BLEED or PAGES

canvasMode(MARGIN); // FACING_MARGINS

 var r = rect(0, 0, width, height);

 var bnds = bounds(r);
 
 fill(255, 0, 0);
 var r2 = rect(bnds.left, bnds.top, bnds.width, bnds.height);

@trych
Copy link
Contributor

trych commented Nov 12, 2018

I think this is also, because the bounds function itself is quite messy and broken and would need a lot of rework. Hence my suggestion to give it up and introduce measure() LINK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants