Operator limits have not kept up with the times #6

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@praecipula

Dear graphic geniuses

When using the cairo gem recently, I noticed that there seems to be an error built into the bounds checking for allowed operators.

Since 1.10, we should be able to use operators above CAIRO_OPERATOR_SATURATE, but the hard limits defined in rb_cairo_constants.c still list that value as CAIRO_OPERATOR_MAX.

When trying to set the operator with Context#operator=, therefore, this error is registered:
`set_operator': invalid operator: 15 (expect 0 <= operator <= 13)

I updated the max limit to be CAIRO_OPERATOR_HSL_LUMINOSITY, which is now the largest supported operator, and was able to make everything work. Please review the commit in this pull request for correctness.

@kou kou added a commit that closed this pull request Jul 20, 2011
@kou kou update cairo_operator_t limitation check for cairo 1.10. fixes #6
Reported by Matt Bramlage. Thanks!!!
9b533a3
@kou kou closed this in 9b533a3 Jul 20, 2011
@kou
Member
kou commented Jul 20, 2011

Thanks for your report!
We also need to support cairo < 1.10. So I add #if for cairo < 1.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment