#ifndef lint static char sccsid[] = "@(#)copyarea.c 9.2 88/01/19 Copyright 1985 Sun Micro"; #endif /* * Copyright (c) 1985 by Sun Microsystems, Inc. */ /*- Copy an area from one place to another in a canvas copyarea.c, Mon Mar 17 12:02:55 1986 James Gosling, Sun Microsystems */ #ifdef REF #include #include #endif #include "shape.h" #include "canvas.h" #include "cursor.h" shape_frcopyarea(gc, mask, dx, dy) register struct graphics_context *gc; fract dx, dy; { register struct shape *outline; struct spoint dl; struct spoint new_pos; sh_frdtransform(&gc->transform, dx, dy); dl.x = roundfr(shape_point.x); dl.y = roundfr(shape_point.y); outline = sh_translate(cv_pathtoshape(gc, mask), dl.x, dl.y); if (outline) { if (gc->clip != ((struct canvas *) gc->canvas)->lastclip && cv_is_canvas(gc->canvas)) cv_validate_clip(gc->canvas, gc->clip); /* * Check cursor intersection with two calls. * First check the destination, then the source. */ cs_checkcursorshape(gc->canvas, outline); new_pos.x = outline->pos.x - dl.x; new_pos.y = outline->pos.y - dl.y; cs_checkcursor(gc->canvas, new_pos.x, new_pos.y, outline->size.x, outline->size.y); /* Do shape rop */ pr_shaperop(gc->canvas, outline, PIX_SRC, gc->canvas, dl.x, dl.y); sh_decref(outline); } cs_newpath(gc); }