feat: Implement 'lineSlider' point method and warn about 'align'

This commit is contained in:
Glen Whitney 2023-10-18 09:14:23 -07:00
parent 277d9b0a8c
commit 4a12367c5d

View File

@ -196,6 +196,12 @@ function dispatchJcommand(
Text("${value}", TitlePoint + (2,5))` Text("${value}", TitlePoint + (2,5))`
'pivot' 'pivot'
return // already handled in postApplets return // already handled in postApplets
'align'
console.warn
'Label alignment is not available in GeoGebra'
'translation, as there is no facility for automatically'
'positioning labels. However, they can be dragged manually.'
return
/e\[\d+\]/ /e\[\d+\]/
num := parseInt(name.slice(2)) num := parseInt(name.slice(2))
{commands, callbacks, parts} := {commands, callbacks, parts} :=
@ -592,6 +598,13 @@ classHandler: Record<JoyceClass, ClassHandler> :=
if args.scalar and args.scalar.length if args.scalar and args.scalar.length
callbacks.push (api: AppletObject) => callbacks.push (api: AppletObject) =>
api.setCoords name, ...args.scalar as XYZ api.setCoords name, ...args.scalar as XYZ
'lineSlider'
pt := args.subpoints
unless pt and pt.length is 2 then return
commands.push `${name} = Point(Line(${pt[0]}, ${pt[1]}))`
if args.scalar and args.scalar.length
callbacks.push (api: AppletObject) =>
api.setCoords name, ...args.scalar as XYZ
'midpoint' 'midpoint'
if args.line if args.line
commands.push `${name} = Midpoint(${args.line[0]})` commands.push `${name} = Midpoint(${args.line[0]})`