Subversion Repositories wimsdev

Rev

Rev 17576 | Rev 17583 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17576 Rev 17581
Line 1... Line 1...
1
# Canvasdraw changes log
1
# Canvasdraw changes log
2
## TODO :
2
## TODO :
3
- sort out the global/local variable mess...and reorganize headerfile
3
- sort out the global/local variable mess...and reorganize headerfile
4
	 : zooming and grid: scaling needs to be more adaptive! (use constant amount of grid lines)
4
	 : zooming and grid: scaling needs to be more adaptive! (use constant amount of grid lines)
5
## 2023
5
## 2023
-
 
6
* 22/2/2023: increase the limit MAX_INT to 256
6
* 21/2/2023: canvasmultidraw now place object with relative coords (%) instead of absolute (px)
7
* 21/2/2023: canvasmultidraw now place object with relative coords (%) instead of absolute (px)
7
* 13/1/2023: corrected flaw in external images 'copy & drag/drop'
8
* 13/1/2023: corrected flaw in external images 'copy & drag/drop'
8
## 2022
9
## 2022
9
* 28/8/2022: added command "newrange xmin,xmax,ymin,ymax" see https://wimsedu.info/?topic=dessiner-des-portions-de-fonctions-sur-un-meme-graphe
10
* 28/8/2022: added command "newrange xmin,xmax,ymin,ymax" see https://wimsedu.info/?topic=dessiner-des-portions-de-fonctions-sur-un-meme-graphe
10
* 01/8/2022: getMouse(),latest improvements related to 'reponsiveness' will fatally lockup browsers in the pixel-by-pixel filling...at least in userdraw clickfill
11
* 01/8/2022: getMouse(),latest improvements related to 'reponsiveness' will fatally lockup browsers in the pixel-by-pixel filling...at least in userdraw clickfill
11
* 19/7/2022: checked and corrected 'dashed' objects like arc,arrowarc,ellipse...
12
* 19/7/2022: checked and corrected 'dashed' objects like arc,arrowarc,ellipse...
12
* 16/7/2022: solved long standing issue of dashed arrow(s) and dashed arrow(s)2 
13
* 16/7/2022: solved long standing issue of dashed arrow(s) and dashed arrow(s)2
13
* 06/7/2022: clearbutton preserves div's with '<' && '/>' and objects placed with `placed_image_on_canvas(id)` e.g. with `id = placed*`
14
* 06/7/2022: clearbutton preserves div's with '<' && '/>' and objects placed with `placed_image_on_canvas(id)` e.g. with `id = placed*`
14
* 05/7/2022: corrected flaw in 'clearbutton' https://wimsedu.info/?topic=geometrie-interactive-avec-canvasdraw
15
* 05/7/2022: corrected flaw in 'clearbutton' https://wimsedu.info/?topic=geometrie-interactive-avec-canvasdraw
15
* 05/7/2022: command 'group' :
16
* 05/7/2022: command 'group' :
16
	- still some issues with direct clicks on group members (NaN due to competing mouselisteners)
17
	- still some issues with direct clicks on group members (NaN due to competing mouselisteners)
17
	- removed 'debug newlines'
18
	- removed 'debug newlines'
Line 55... Line 56...
55
* 19/6/2022: added function plot to multidraw (https://wimsedu.info/?topic=userinput-function)
56
* 19/6/2022: added function plot to multidraw (https://wimsedu.info/?topic=userinput-function)
56
	command 'multidraw functions' will -for now- give just 2 inputfields... *TODO*: make configurable, so implement commands like 'multidraw functions5')
57
	command 'multidraw functions' will -for now- give just 2 inputfields... *TODO*: make configurable, so implement commands like 'multidraw functions5')
57
	for multiple function input fields, use multiple keywords 'function', e.g. something like:
58
	for multiple function input fields, use multiple keywords 'function', e.g. something like:
58
	multidraw text,line,function,function,function,points
59
	multidraw text,line,function,function,function,points
59
* 27/5/2022: added subsup to userdraw and multidraw 'text' (which is always 'centered' e.g use_offset=4)
60
* 27/5/2022: added subsup to userdraw and multidraw 'text' (which is always 'centered' e.g use_offset=4)
60
* 26/5/2022: corrected replyformat 100 
61
* 26/5/2022: corrected replyformat 100
61
* 23/5/2022: overriding fontfamily and use Helvetica as font for _sub ^sup  strings: all inline numbers are in script-size (80% eg the same as strings+numbers for sub/sup)
62
* 23/5/2022: overriding fontfamily and use Helvetica as font for _sub ^sup  strings: all inline numbers are in script-size (80% eg the same as strings+numbers for sub/sup)
62
* 21/5/2022: using 'scriptsize' imitation on sub / sup  
63
* 21/5/2022: using 'scriptsize' imitation on sub / sup
63
* 20/5/2022: added a sub / sup imitation to the canvas 'string' command family
64
* 20/5/2022: added a sub / sup imitation to the canvas 'string' command family
64
 
65
 
65
		size 400,400
66
		size 400,400
66
		xrange -6,6
67
		xrange -6,6
67
		yrange -6,6
68
		yrange -6,6
Line 74... Line 75...
74
* 2/4/2022: added timeout fix for centering issue in case of MathJaX (draw_xml())
75
* 2/4/2022: added timeout fix for centering issue in case of MathJaX (draw_xml())
75
 
76
 
76
## 2021
77
## 2021
77
* 14/4/2021: added flydraw command 'range xmin,xmax,ymin,ymax'
78
* 14/4/2021: added flydraw command 'range xmin,xmax,ymin,ymax'
78
* 6/4/2021: corrected 'text objects' (from cmd's text/string) were not added to 'noreset', e.g. keyword 'noreset' was ignored...
79
* 6/4/2021: corrected 'text objects' (from cmd's text/string) were not added to 'noreset', e.g. keyword 'noreset' was ignored...
79
added a live example from E3/number/oefgraduation.fr  
80
added a live example from E3/number/oefgraduation.fr
80
* 4/4/2021: corrected use of precompiler directive "KATEX_INSTALLED" (was not working...)
81
* 4/4/2021: corrected use of precompiler directive "KATEX_INSTALLED" (was not working...)
81
* 12/3/2021: add "version 0.5" to canvasdraw include file
82
* 12/3/2021: add "version 0.5" to canvasdraw include file
82
* 23/2/2021:
83
* 23/2/2021:
83
added generic command 'kill argument'
84
added generic command 'kill argument'
84
work in progress
85
work in progress
Line 91... Line 92...
91
resetting dashing for the arrow head (head was also dashed...)
92
resetting dashing for the arrow head (head was also dashed...)
92
see https://wimsedu.info/?topic=dashed-arrows-not-dashed-in-canvasdraw
93
see https://wimsedu.info/?topic=dashed-arrows-not-dashed-in-canvasdraw
93
* 2/2/2021:
94
* 2/2/2021:
94
added command 'arcarrow|arrowarc', left,right,left/right
95
added command 'arcarrow|arrowarc', left,right,left/right
95
added commands 'arc','angle','arcarrow' to onclick and drag&drop
96
added commands 'arc','angle','arcarrow' to onclick and drag&drop
96
* 17/1/2021: 
97
* 17/1/2021:
97
corrected syntax issue in canvasmultidraw.c signalled by Opera Presto : 'forbidden function user_drawstop(evt) declaration in statement'*/
98
corrected syntax issue in canvasmultidraw.c signalled by Opera Presto : 'forbidden function user_drawstop(evt) declaration in statement'*/
98
 
99
 
99
can not correct centering in case of MathJaX, in commands like
100
can not correct centering in case of MathJaX, in commands like
100
 
101
 
101
```
102
```
Line 123... Line 124...
123
 function read_canvas(){
124
 function read_canvas(){
124
   var fun = eval("read_canvas"+canvas_scripts[0]);
125
   var fun = eval("read_canvas"+canvas_scripts[0]);
125
   if( typeof fun === 'function'){ return fun();};
126
   if( typeof fun === 'function'){ return fun();};
126
 };
127
 };
127
 function read_dragdrop(){
128
 function read_dragdrop(){
128
   var fun = eval("read_dragdrop"+canvas_scripts[0]); 
129
   var fun = eval("read_dragdrop"+canvas_scripts[0]);
129
   if(typeof fun === 'function'){return fun();};
130
   if(typeof fun === 'function'){return fun();};
130
 };
131
 };
131
 
132
 
132
</script>
133
</script>
133
<br/>
134
<br/>
Line 135... Line 136...
135
<span id="m2" onclick="javascript:place_image_on_canvas(this.id)" >\m2</span>
136
<span id="m2" onclick="javascript:place_image_on_canvas(this.id)" >\m2</span>
136
<span id="m3" onclick="javascript:place_image_on_canvas(this.id)" >\m3</span>
137
<span id="m3" onclick="javascript:place_image_on_canvas(this.id)" >\m3</span>
137
<span id="m4" onclick="javascript:place_image_on_canvas(this.id)" >\m4</span>
138
<span id="m4" onclick="javascript:place_image_on_canvas(this.id)" >\m4</span>
138
 
139
 
139
\canvasdraw{400,400}{
140
\canvasdraw{400,400}{
140
xrange -10,10
141
xrange -10,10
141
yrange -10,10
142
yrange -10,10
142
grid 1,1,grey
143
grid 1,1,grey
143
noreset
144
noreset
144
# use keyword 'noreset' to avoid using keyword 'centered' before every addition of objects !
145
# use keyword 'noreset' to avoid using keyword 'centered' before every addition of objects !
145
centered
146
centered
146
fontfamily Bold Italic 42pt Courier
147
fontfamily Bold Italic 42pt Courier
Line 172... Line 173...
172
<td><img src="gifs/de.gif" onclick='javascript:place_image_on_canvas(this.id);' id="de" /></td>
173
<td><img src="gifs/de.gif" onclick='javascript:place_image_on_canvas(this.id);' id="de" /></td>
173
</tr>
174
</tr>
174
</table>
175
</table>
175
   <input type="button" onclick="alert(read_canvas());" value="read_canvas()" />
176
   <input type="button" onclick="alert(read_canvas());" value="read_canvas()" />
176
   <input type="button" onclick="alert(read_dragdrop());" value="read_dragdrop()" />
177
   <input type="button" onclick="alert(read_dragdrop());" value="read_dragdrop()" />
177
}
178
}
178
```
179
```
179
 
180
 
180
* 15/1/2021:
181
* 15/1/2021:
181
corrected long standing flaw regarding "centered" on external stuff...tested: bitmap,svg,TeX [on KaTeX]
182
corrected long standing flaw regarding "centered" on external stuff...tested: bitmap,svg,TeX [on KaTeX]
182
corrected 'onclick' for 'draw_xml()'
183
corrected 'onclick' for 'draw_xml()'
183
 
184
 
184
* 14/1/2021: 
185
* 14/1/2021:
185
only on KaTeX enabled wims, a slider title may use TeX produced by command "mathmlmath"
186
only on KaTeX enabled wims, a slider title may use TeX produced by command "mathmlmath"
186
 
187
 
187
* 13/1/2021:
188
* 13/1/2021:
188
slider title may use TeX produced by command "mathmlmath"
189
slider title may use TeX produced by command "mathmlmath"
189
 
190
 
Line 223... Line 224...
223
latex -5,0,\C
224
latex -5,0,\C
224
killslider)
225
killslider)
225
}
226
}
226
\statement{
227
\statement{
227
canvas = \canvas
228
canvas = \canvas
228
} 
229
}
229
```
230
```
230
 
231
 
231
* 8/1/2021:
232
* 8/1/2021:
232
added affine transformation to Fly text commmand analogue
233
added affine transformation to Fly text commmand analogue
233
 
234
 
Line 264... Line 265...
264
curve green,2*t,sin(2*pi*t)
265
curve green,2*t,sin(2*pi*t)
265
```
266
```
266
 
267
 
267
* 22/12/2020:
268
* 22/12/2020:
268
command "fillpattern image_url" was gone fishing! `get_image_from_url()` needs to be called after function definition..
269
command "fillpattern image_url" was gone fishing! `get_image_from_url()` needs to be called after function definition..
269
* 16/11/2020: 
270
* 16/11/2020:
270
	- added 'affine' to curve evaluation
271
	- added 'affine' to curve evaluation
271
 
272
 
272
	```
273
	```
273
	size 220,220
274
	size 220,220
274
	xrange -5,5
275
	xrange -5,5
Line 281... Line 282...
281
	curve blue,sin(x)
282
	curve blue,sin(x)
282
	affine 1,-0.2,-0.6,1,0,2
283
	affine 1,-0.2,-0.6,1,0,2
283
	curve red,sin(x)
284
	curve red,sin(x)
284
	```
285
	```
285
 
286
 
286
* 13/11/2020: 
287
* 13/11/2020:
287
	- added `safe_eval()` to userinput (using inputfields)
288
	- added `safe_eval()` to userinput (using inputfields)
288
 
289
 
289
* 8/7/2020:
290
* 8/7/2020:
290
	- command `input x,y,size,readonly,value` gave canvaserror when 'value' was ommitted or a 'space'
291
	- command `input x,y,size,readonly,value` gave canvaserror when 'value' was ommitted or a 'space'
291
	- corrected bug [https://wimsedu.info/?topic=bug-canvasdraw-et-ou-drawinput]()
292
	- corrected bug [https://wimsedu.info/?topic=bug-canvasdraw-et-ou-drawinput]()
Line 310... Line 311...
310
		size 400,400
311
		size 400,400
311
		xrange -6,6
312
		xrange -6,6
312
		yrange -6,6
313
		yrange -6,6
313
		fontsize 40
314
		fontsize 40
314
		linewidth 1
315
		linewidth 1
315
		slider -10,10,300,28,angle active degree, 
316
		slider -10,10,300,28,angle active degree,
316
		centered
317
		centered
317
		html 0,0,<img src="modules/U2/geometry/oefrosoni.it/images/273x273/fig4.png"  />
318
		html 0,0,<img src="modules/U2/geometry/oefrosoni.it/images/273x273/fig4.png"  />
318
		killslider
319
		killslider
319
		centered
320
		centered
320
		html 0,0,<img src="modules/U2/geometry/oefrosoni.it/images/273x273/fig4_ovr.png"  />
321
		html 0,0,<img src="modules/U2/geometry/oefrosoni.it/images/273x273/fig4_ovr.png"  />
Line 366... Line 367...
366
	- restored interaction of commands 'arc' and 'angle' with sliders (specially Rotate)
367
	- restored interaction of commands 'arc' and 'angle' with sliders (specially Rotate)
367
	- drawxml() objects like katex,mathml,latex,html,obabel now interact identical as
368
	- drawxml() objects like katex,mathml,latex,html,obabel now interact identical as
368
    dragstuff library objects with slider...eg. 'first click'=select for sliders, 'second click' unselect sliders
369
    dragstuff library objects with slider...eg. 'first click'=select for sliders, 'second click' unselect sliders
369
    e.g.: `slidergroup[object_cnt] = obj or slidergroup[object_cnt] = null`
370
    e.g.: `slidergroup[object_cnt] = obj or slidergroup[object_cnt] = null`
370
    selected sliders until 'killslider'
371
    selected sliders until 'killslider'
371
    
372
 
372
    ```
373
    ```
373
	######################################################
374
	######################################################
374
	size 500,500
375
	size 500,500
375
	xrange -6,6
376
	xrange -6,6
376
	yrange -6,6
377
	yrange -6,6
Line 645... Line 646...
645
	- TODO : rethink zooming & panning !!
646
	- TODO : rethink zooming & panning !!
646
 
647
 
647
	```
648
	```
648
	##############
649
	##############
649
	performance/size_reductions:
650
	performance/size_reductions:
650
	
651
 
651
	U1/logic/oefmap.fr&+cmd=new&defaultlist=free01&+exo=free01&+qnum=1&+scoredelay=&+seedrepeat=0&+qcmlevel=1
652
	U1/logic/oefmap.fr&+cmd=new&defaultlist=free01&+exo=free01&+qnum=1&+scoredelay=&+seedrepeat=0&+qcmlevel=1
652
		- old canvasdraw version approx 40 kb
653
		- old canvasdraw version approx 40 kb
653
		- new canvasdraw version approx 20 kb
654
		- new canvasdraw version approx 20 kb
654
		- latest canvasdraw version approx 18 kb
655
		- latest canvasdraw version approx 18 kb
655
	
656
 
656
	H5/analysis/gebieden-1.nl&subject=4&level=0&total_exos=3&rounding=-1&usage=2&taal=nl
657
	H5/analysis/gebieden-1.nl&subject=4&level=0&total_exos=3&rounding=-1&usage=2&taal=nl
657
		- old canvasdraw version approx 83 kb
658
		- old canvasdraw version approx 83 kb
658
		- new canvasdraw version approx 38 kb
659
		- new canvasdraw version approx 38 kb
659
	##############
660
	##############
660
	```
661
	```
Line 662... Line 663...
662
	- split large files into fragments:still needs some further shifting/reorganizing
663
	- split large files into fragments:still needs some further shifting/reorganizing
663
	- multidraw: add draw primitive: crosshair | crosshairs (draw_type no. 25 | 26)
664
	- multidraw: add draw primitive: crosshair | crosshairs (draw_type no. 25 | 26)
664
    TODO: arc,angle,ellipse??
665
    TODO: arc,angle,ellipse??
665
 
666
 
666
	- multidraw: finished fillpatterns
667
	- multidraw: finished fillpatterns
667
 
668
 
668
```
669
```
669
size 400,400
670
size 400,400
670
xrange -10,10
671
xrange -10,10
671
yrange -10,10
672
yrange -10,10
672
grid 1,1,grey
673
grid 1,1,grey
673
linewidth  3
674
linewidth  3
674
snaptogrid
675
snaptogrid
Line 695... Line 696...
695
 
696
 
696
* 6/1/2020
697
* 6/1/2020
697
	- "stringup" now can be "onclick & dragdrop"
698
	- "stringup" now can be "onclick & dragdrop"
698
eg: stringup == string+angle+mouse_rotation-code
699
eg: stringup == string+angle+mouse_rotation-code
699
note: no need to reset rotation through 'killrotate'
700
note: no need to reset rotation through 'killrotate'
700
	
701
 
701
	```
702
	```
702
	onclick
703
	onclick
703
	rotate 45
704
	rotate 45
704
	string red,0,0,AAAAAA
705
	string red,0,0,AAAAAA
705
	killrotate
706
	killrotate
706
	string red,4,4,BBBBBB
707
	string red,4,4,BBBBBB
707
	```
708
	```
708
	
709
 
709
	is identical with:
710
	is identical with:
710
	
711
 
711
	```
712
	```
712
	onclick
713
	onclick
713
	stringup red,0,0,45,AAAAAA
714
	stringup red,0,0,45,AAAAAA
714
	string red,4,4,BBBBBB
715
	string red,4,4,BBBBBB
715
	```
716
	```
Line 1555... Line 1556...
1555
	added command 'snaptofunction some_fun_x,some_fun_y'
1556
	added command 'snaptofunction some_fun_x,some_fun_y'
1556
 
1557
 
1557
		frect -3,3,0,0,red
1558
		frect -3,3,0,0,red
1558
		slider -5,5,120,10,x function display,some_text
1559
		slider -5,5,120,10,x function display,some_text
1559
		sliderfunction_x 5*sin(x)
1560
		sliderfunction_x 5*sin(x)
1560
	
1561
 
1561
		'sliderfunction_y some_operation_on_y'
1562
		'sliderfunction_y some_operation_on_y'
1562
		'sliderfunction_x some_operation_on_x'
1563
		'sliderfunction_x some_operation_on_x'
1563
		added command
1564
		added command
1564
		added argument 'function' to the slider objects.
1565
		added argument 'function' to the slider objects.
1565
* 28/4	removed point2point...
1566
* 28/4	removed point2point...