mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-23 11:51:27 +00:00
Get DPSshow: to work on scaled windows.
This commit is contained in:
parent
3adb72d6e2
commit
c379156931
2 changed files with 16 additions and 9 deletions
|
@ -1,3 +1,8 @@
|
|||
2017-07-31 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/cairo/CairoGState.m (-DPSshow:): Get DPSshow: to work on
|
||||
scaled windows.
|
||||
|
||||
2017-04-16 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/gsc/GSGState.m
|
||||
|
|
|
@ -386,9 +386,8 @@ static inline cairo_filter_t cairoFilterFromNSImageInterpolation(NSImageInterpol
|
|||
{
|
||||
if (_ct)
|
||||
{
|
||||
cairo_matrix_t saved_matrix;
|
||||
cairo_matrix_t local_matrix;
|
||||
NSPoint p = [path currentPoint];
|
||||
NSAffineTransformStruct matrix = [ctm transformStruct];
|
||||
device_color_t c;
|
||||
|
||||
c = strokeColor;
|
||||
|
@ -396,16 +395,19 @@ static inline cairo_filter_t cairoFilterFromNSImageInterpolation(NSImageInterpol
|
|||
// The underlying concept does not allow to determine if alpha is set or not.
|
||||
cairo_set_source_rgba(_ct, c.field[0], c.field[1], c.field[2], c.field[AINDEX]);
|
||||
|
||||
cairo_get_matrix(_ct, &saved_matrix);
|
||||
[self _setPoint];
|
||||
cairo_save(_ct);
|
||||
cairo_matrix_init(&local_matrix, matrix.m11, 0, 0,
|
||||
matrix.m22, 0, 0);
|
||||
cairo_transform(_ct, &local_matrix);
|
||||
// Undo the flip
|
||||
cairo_matrix_init_scale(&local_matrix, 1, -1);
|
||||
cairo_matrix_translate(&local_matrix, 0, -[_surface size].height);
|
||||
cairo_transform(_ct, &local_matrix);
|
||||
|
||||
cairo_matrix_init_scale(&local_matrix, 1, 1);
|
||||
cairo_matrix_translate(&local_matrix, 0, [_surface size].height-(p.y*2));
|
||||
cairo_set_matrix(_ct, &local_matrix);
|
||||
|
||||
cairo_move_to(_ct, p.x, p.y);
|
||||
cairo_show_text(_ct, s);
|
||||
|
||||
cairo_set_matrix(_ct, &saved_matrix);
|
||||
cairo_restore(_ct);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue