From: Linus Torvalds Date: Wed, 7 Sep 2011 21:37:47 +0000 (-0700) Subject: Fix up horribly broken cairo scaling X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;ds=inline;h=d4a1dfb3d9a6a8f89d5f543ba1ad2eea091c813c;hp=d4a1dfb3d9a6a8f89d5f543ba1ad2eea091c813c;p=ext%2Fsubsurface.git Fix up horribly broken cairo scaling The way cairo does scaling is really really inconvenient, and one of the things in cairo that is fundamentally mis-designed. Cairo scaling always affects both coordinates and object sizes, and the two can apparently never be split apart. Which is very much not what we want: we want just coordinate scaling. So we cannot use 'cairo_scale()' to scale our canvas, because that screws up lines and text size too. And no, you cannot "fix" that by de-scaling the line size etc - because line size is one-dimensional, so you can't undo the (different) scaling in X/Y. Sad. I realize that often you do want to scale object size with coordinate transformation, but quite often you *don't* want to. Yeah, we could do random context save/restore in odd places etc, but that's just a sign of the bad design of cairo scaling. Work around it by introducing our own graphics context with scaling, which does it right. I don't like this, but it seems to be better than the alternatives. Signed-off-by: Linus Torvalds ---