Check-in [e95304b5ba]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:reapplied patch for ticket [36481a3e08]
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e95304b5ba14658c770575a22f1061435e119444
User & Date: chw 2019-07-10 13:05:52
References
2019-07-10
13:06 Ticket [36481a3e08] Make tkp::matrix::rotate accept angles in degrees too status still Review with 3 other changes artifact: e4c55cb119 user: chw
Context
2019-07-12
04:20
add tk upstream changes check-in: bc74183392 user: chw tags: trunk
2019-07-10
13:05
reapplied patch for ticket [36481a3e08] check-in: e95304b5ba user: chw tags: trunk
04:34
better fixes for ticket [36481a3e08] check-in: d5b30d3ec3 user: chw tags: trunk
Changes

Changes to jni/tkpath/library/tkpath.tcl.

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
..
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
...
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
...
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
...
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
#	angle	Angle in radians or degrees (with "d" suffix)
#	cx	X-center coordinate
#	cy	Y-center coordinate
# Results:
#       The transformation matrix.
proc ::tkp::matrix::rotate {angle {cx 0} {cy 0}} {
    if {[string match "*d" $angle]} {
	set angle [expr {[string range $angle 0 end-1] / 0.017453292519943295}]
    }
    set myCos [expr {cos($angle)}]
    set mySin [expr {sin($angle)}]
    if {$cx == 0 && $cy == 0} {
	return [list [list $myCos $mySin] [list [expr {-1.*$mySin}] $myCos] {0 0}]
    }
    return [list [list $myCos $mySin] [list [expr {-1.*$mySin}] $myCos] \
................................................................................
#	cy	Y-center coordinate
#	fx	1 no flip, -1 horizontal flip
#	fy	1 no flip, -1 vertical flip
# Results:
#       The transformation matrix.
proc ::tkp::matrix::rotateflip {{angle 0} {cx 0} {cy 0} {fx 1} {fy 1}} {
    if {[string match "*d" $angle]} {
	set angle [expr {[string range $angle 0 end-1] / 0.017453292519943295}]
    }
    set myCos [expr {cos($angle)}]
    set mySin [expr {sin($angle)}]
    if {$cx == 0 && $cy == 0} {
	return [list [list [expr {$fx*$myCos}] [expr {$fx*$mySin}]] \
	    [list [expr {-1.*$mySin*$fy}] [expr {$myCos*$fy}]] {0 0}]
    }
................................................................................
# ::tkp::matrix::skewx --
# Arguments:
#	angle	Angle in radians or degrees (with "d" suffix)
# Results:
#       The transformation matrix.
proc ::tkp::matrix::skewx {angle} {
    if {[string match "*d" $angle]} {
	set angle [expr {[string range $angle 0 end-1] / 0.017453292519943295}]
    }
    return [list {1 0} [list [expr {tan($angle)}] 1] {0 0}]
}

# ::tkp::matrix::skewy --
# Arguments:
#	angle	Angle in radians or degrees (with "d" suffix)
# Results:
#       The transformation matrix.
proc ::tkp::matrix::skewy {angle} {
    if {[string match "*d" $angle]} {
	set angle [expr {[string range $angle 0 end-1] / 0.017453292519943295}]
    }
    return [list [list 1 [expr {tan($angle)}]] {0 1} {0 0}]
}

# ::tkp::matrix::move --
# Arguments:
#	dx	Difference in x direction
................................................................................
#	cy	center y coordinate
#	a	angle in radians or degrees (with "d" suffix)
#	d ...	distances
# Results:
#	Return points at given distances on a ray from center x,y to angle a.
proc ::tkp::path::cg::xyad2p {cx cy a d args} {
    if {[string match "*d" $a]} {
	set a [expr {[string range $a 0 end-1] / 0.017453292519943295}]
    }
    lmap d [concat $d $args] {
	list [expr {$cx + $d * cos($a)}] [expr {$cy - $d * sin($a)}]
    }
}

# ::tkp::path::cg::xyra2p
................................................................................
#	cy	center y coordinate
#	r	radius
#	a	angle in radians or degrees (with "d" suffix)
# Results:
#	Return points forming angle a on a circle with radius r.
proc ::tkp::path::cg::xyra2p {cx cy r a args} {
    if {[string match "*d" $a]} {
	set a [expr {[string range $a 0 end-1] / 0.017453292519943295}]
    }
    lmap a [concat $a $args] {
	list [expr {$cx + $r * cos($a)}] [expr {$cy - $r * sin($a)}]
    }
}

# ::tkp::path::ellipse --







|







 







|







 







|











|







 







|







 







|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
..
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
...
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
...
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
...
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
#	angle	Angle in radians or degrees (with "d" suffix)
#	cx	X-center coordinate
#	cy	Y-center coordinate
# Results:
#       The transformation matrix.
proc ::tkp::matrix::rotate {angle {cx 0} {cy 0}} {
    if {[string match "*d" $angle]} {
	set angle [expr {[string range $angle 0 end-1] * 0.017453292519943295}]
    }
    set myCos [expr {cos($angle)}]
    set mySin [expr {sin($angle)}]
    if {$cx == 0 && $cy == 0} {
	return [list [list $myCos $mySin] [list [expr {-1.*$mySin}] $myCos] {0 0}]
    }
    return [list [list $myCos $mySin] [list [expr {-1.*$mySin}] $myCos] \
................................................................................
#	cy	Y-center coordinate
#	fx	1 no flip, -1 horizontal flip
#	fy	1 no flip, -1 vertical flip
# Results:
#       The transformation matrix.
proc ::tkp::matrix::rotateflip {{angle 0} {cx 0} {cy 0} {fx 1} {fy 1}} {
    if {[string match "*d" $angle]} {
	set angle [expr {[string range $angle 0 end-1] * 0.017453292519943295}]
    }
    set myCos [expr {cos($angle)}]
    set mySin [expr {sin($angle)}]
    if {$cx == 0 && $cy == 0} {
	return [list [list [expr {$fx*$myCos}] [expr {$fx*$mySin}]] \
	    [list [expr {-1.*$mySin*$fy}] [expr {$myCos*$fy}]] {0 0}]
    }
................................................................................
# ::tkp::matrix::skewx --
# Arguments:
#	angle	Angle in radians or degrees (with "d" suffix)
# Results:
#       The transformation matrix.
proc ::tkp::matrix::skewx {angle} {
    if {[string match "*d" $angle]} {
	set angle [expr {[string range $angle 0 end-1] * 0.017453292519943295}]
    }
    return [list {1 0} [list [expr {tan($angle)}] 1] {0 0}]
}

# ::tkp::matrix::skewy --
# Arguments:
#	angle	Angle in radians or degrees (with "d" suffix)
# Results:
#       The transformation matrix.
proc ::tkp::matrix::skewy {angle} {
    if {[string match "*d" $angle]} {
	set angle [expr {[string range $angle 0 end-1] * 0.017453292519943295}]
    }
    return [list [list 1 [expr {tan($angle)}]] {0 1} {0 0}]
}

# ::tkp::matrix::move --
# Arguments:
#	dx	Difference in x direction
................................................................................
#	cy	center y coordinate
#	a	angle in radians or degrees (with "d" suffix)
#	d ...	distances
# Results:
#	Return points at given distances on a ray from center x,y to angle a.
proc ::tkp::path::cg::xyad2p {cx cy a d args} {
    if {[string match "*d" $a]} {
	set a [expr {[string range $a 0 end-1] * 0.017453292519943295}]
    }
    lmap d [concat $d $args] {
	list [expr {$cx + $d * cos($a)}] [expr {$cy - $d * sin($a)}]
    }
}

# ::tkp::path::cg::xyra2p
................................................................................
#	cy	center y coordinate
#	r	radius
#	a	angle in radians or degrees (with "d" suffix)
# Results:
#	Return points forming angle a on a circle with radius r.
proc ::tkp::path::cg::xyra2p {cx cy r a args} {
    if {[string match "*d" $a]} {
	set a [expr {[string range $a 0 end-1] * 0.017453292519943295}]
    }
    lmap a [concat $a $args] {
	list [expr {$cx + $r * cos($a)}] [expr {$cy - $r * sin($a)}]
    }
}

# ::tkp::path::ellipse --