-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
ofCairoRenderer stops working after setting ofScale(0, 0); #6715
Comments
I imagine what you mean is that it doesn't work afterwards even changing back the scale? It might be introducing some NaNs and never recover from it |
@arturoc yes this is what I mean. |
EDIT: found some more details. ofScale(0.5, 0.5);
ofDrawCircle(100,100,100); it accumulates, shrinking the size. The same happens with ofTranslate cairo_matrix_t matrix;
cairo_matrix_init_scale(&matrix,xAmnt,yAmnt);
cairo_set_matrix(cr,&matrix); and the same for translation. but this is almost like another issue. void ofCairoRenderer::scale(float xAmnt, float yAmnt, float zAmnt ){
if (xAmnt == 0 || yAmnt == 0) return;
ideas? |
one possible solution is adding some lines to setupGraphicsDefaults, so it resets the matrix in new frames. ofSetCurrentRenderer(cairo, true); //----------------------------------------------------------
void ofCairoRenderer::setupGraphicDefaults(){
setStyle(ofStyle());
path.setMode(ofPath::COMMANDS);
path.setUseShapeColor(false);
clear();
// new lines
cairo_matrix_t matrix;
cairo_matrix_init_scale(&matrix, 1.0, 1.0);
cairo_matrix_init_translate(&matrix, 0.0, 0.0);
cairo_set_matrix(cr,&matrix);
}; |
Closed by #6991 |
I've noticed ofCairoRenderer stops working after setting ofScale(0, 0)
Maybe there is some destructive scale happening there. easy to reproduce.
Thanks
The text was updated successfully, but these errors were encountered: