diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-05-10 08:04:39 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-05-10 08:04:39 (GMT) |
commit | ebee84d3759fbe688f9a527facf83e5dc30ae5a0 (patch) | |
tree | 9b196dabbce4109b631ce7307b57a7e821113912 /doc/CrtItemType.3 | |
parent | 2cf64c85fc09764112c6d2daa54f22c9b2c3b549 (diff) | |
parent | 50b390e8c37fc97708f980d5cdd9fb5480b64e4c (diff) | |
download | tk-ebee84d3759fbe688f9a527facf83e5dc30ae5a0.zip tk-ebee84d3759fbe688f9a527facf83e5dc30ae5a0.tar.gz tk-ebee84d3759fbe688f9a527facf83e5dc30ae5a0.tar.bz2 |
Merge trunk
Diffstat (limited to 'doc/CrtItemType.3')
-rw-r--r-- | doc/CrtItemType.3 | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/doc/CrtItemType.3 b/doc/CrtItemType.3 index 9422668..cd270f4 100644 --- a/doc/CrtItemType.3 +++ b/doc/CrtItemType.3 @@ -83,6 +83,9 @@ typedef struct Tk_ItemType { Tk_ItemInsertProc *\fIinsertProc\fR; Tk_ItemDCharsProc *\fIdCharsProc\fR; Tk_ItemType *\fInextPtr\fR; +.VS "8.7, TIP164" + Tk_ItemRotateProc *\fIrotateProc\fR; +.VE "8.7, TIP164" } \fBTk_ItemType\fR; .CE .PP @@ -549,6 +552,46 @@ and \fIdeltaX\fR and \fIdeltaY\fR give the amounts that should be added to each x and y coordinate within the item. The type manager should adjust the item's coordinates and update the bounding box in the item's header. +.SS ROTATEPROC +.VS "8.7, TIP164" +.PP +\fItypePtr\->rotateProc\fR is invoked by Tk to rotate a canvas item +during the \fBrotate\fR widget command. +The procedure must match the following prototype: +.PP +.CS +typedef void \fBTk_ItemRotateProc\fR( + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + double \fIoriginX\fR, + double \fIoriginY\fR, + double \fIangleRad\fR); +.CE +.PP +The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning. +\fIoriginX\fR and \fIoriginY\fR specify an origin relative to which +the item is to be rotated, and \fIangleRad\fR gives the anticlockwise +rotation to be applied in radians. +The item should adjust the coordinates of its control points so that where +they used to have coordinates \fIx\fR and \fIy\fR, they will have new +coordinates \fIx\(fm\fR and \fIy\(fm\fR, where +.PP +.CS +\fIrelX\fR = \fIx\fR - \fIoriginX\fR +\fIrelY\fR = \fIy\fR - \fIoriginY\fR +\fIx\(fm\fR = \fIoriginX\fR + \fIrelX\fR \(mu cos(\fIangleRad\fR) + \fIrelY\fR \(mu sin(\fIangleRad\fR) +\fIy\(fm\fR = \fIoriginY\fR \(mi \fIrelX\fR \(mu sin(\fIangleRad\fR) + \fIrelY\fR \(mu cos(\fIangleRad\fR) +.CE +.PP +The control points for an item are not necessarily the coordinates provided to +the item when it is created (or via the \fItypePtr\->coordProc\fR), but could +instead be derived from them. +\fIrotateProc\fR must also update the bounding box in the item's header. +.PP +Item types do not need to provide a \fItypePtr\->rotateProc\fR. If the +\fItypePtr\->rotateProc\fR is NULL, the \fItypePtr\->coordProc\fR will be +used instead to retrieve and update the list of coordinates. +.VE "8.7, TIP164" .SS INDEXPROC .PP \fItypePtr\->indexProc\fR is invoked by Tk to translate a string |