Applied an upside-down scale transformation to the pattern matrix,
otherwise patterns end up upside-down relative to other graphics interfaces.
This commit is contained in:
parent
bf5bb09f50
commit
f12d98c2c7
|
|
@ -216,6 +216,8 @@ grtcairoSetStipple (stipple)
|
||||||
int stipple; /* The stipple number to be used. */
|
int stipple; /* The stipple number to be used. */
|
||||||
{
|
{
|
||||||
static int oldStip = -1;
|
static int oldStip = -1;
|
||||||
|
cairo_matrix_t matrix;
|
||||||
|
|
||||||
if (stipple == oldStip) return;
|
if (stipple == oldStip) return;
|
||||||
oldStip = stipple;
|
oldStip = stipple;
|
||||||
GR_TCAIRO_FLUSH_BATCH();
|
GR_TCAIRO_FLUSH_BATCH();
|
||||||
|
|
@ -223,6 +225,10 @@ int stipple; /* The stipple number to be used. */
|
||||||
currentStipple = cairo_pattern_create_rgba(0, 0, 0, 1);
|
currentStipple = cairo_pattern_create_rgba(0, 0, 0, 1);
|
||||||
} else {
|
} else {
|
||||||
if (stipplePatterns[stipple] == (cairo_pattern_t *)NULL) MainExit(1);
|
if (stipplePatterns[stipple] == (cairo_pattern_t *)NULL) MainExit(1);
|
||||||
|
|
||||||
|
/* Patterns will be upside-down if not transformed like the window */
|
||||||
|
cairo_matrix_init_scale (&matrix, 1.0, -1.0);
|
||||||
|
cairo_pattern_set_matrix (stipplePatterns[stipple], &matrix);
|
||||||
cairo_pattern_set_extend(stipplePatterns[stipple], CAIRO_EXTEND_REPEAT);
|
cairo_pattern_set_extend(stipplePatterns[stipple], CAIRO_EXTEND_REPEAT);
|
||||||
cairo_pattern_set_filter(stipplePatterns[stipple], CAIRO_FILTER_NEAREST);
|
cairo_pattern_set_filter(stipplePatterns[stipple], CAIRO_FILTER_NEAREST);
|
||||||
currentStipple = stipplePatterns[stipple];
|
currentStipple = stipplePatterns[stipple];
|
||||||
|
|
|
||||||
|
|
@ -743,8 +743,8 @@ typedef struct LayerInstance {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int ImgLayerCreate _ANSI_ARGS_((Tcl_Interp *interp,
|
static int ImgLayerCreate _ANSI_ARGS_((Tcl_Interp *interp,
|
||||||
const char *name, int argc, Tcl_Obj *CONST objv[],
|
CONST86 char *name, int argc, Tcl_Obj *const objv[],
|
||||||
const Tk_ImageType *typePtr, Tk_ImageMaster master,
|
CONST86 Tk_ImageType *typePtr, Tk_ImageMaster master,
|
||||||
ClientData *clientDataPtr));
|
ClientData *clientDataPtr));
|
||||||
static ClientData ImgLayerGet _ANSI_ARGS_((Tk_Window tkwin,
|
static ClientData ImgLayerGet _ANSI_ARGS_((Tk_Window tkwin,
|
||||||
ClientData clientData));
|
ClientData clientData));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue