Commit Graph

76 Commits

Author SHA1 Message Date
Quentin Guidée
b26a35a200 Merge remote-tracking branch 'upstream/master' into omega-hotfix 2020-02-25 15:21:24 +01:00
Léa Saviot
383aafcc55 [python/modion] Allow interruption of modion_keyboard_keydown 2020-02-25 15:17:13 +01:00
Quentin Guidée
24907511f5 Fix conflicts 2020-02-23 13:27:10 +01:00
Léa Saviot
8fe41a8673 [python/modkandinsky] fillRect accepts negative width and height 2020-02-21 16:04:05 +01:00
Quentin Guidée
ab8f731515 Fixed some conflicts 2020-02-12 17:42:58 +01:00
Ruben Dashyan
8d3f86c77f [kandinsky/context] getPixel only if in the clipping rect
Fixes the redrawing of RoundCursorView when its frame overlaps the
clipping rect.
2020-02-12 15:13:24 +01:00
Léa Saviot
86bd4be03e [python/port] Fix gc_collect_root on emscripten
Any data access should be aligned.
2020-02-12 15:13:22 +01:00
Léa Saviot
42bdf29ead [python] Fix compilation warnings 2020-02-12 15:13:22 +01:00
Léa Saviot
ac6ce97dea [python/modturtle] Allowinterruption during reset
Scenario:
fro m turtle import *
while 1==1:
  reset()
-> This script cannot be interrupted
2020-02-12 15:13:21 +01:00
Émilie Feral
37061b9cb5 [python] Fix gc_collect to be sure to get unaligned pointers 2020-02-12 15:13:16 +01:00
elicolh
77a3b492fd switching right and up in get_keys() 2020-01-15 18:55:30 +01:00
Damien Nicolet
8583ddafca External application, API v2 2019-12-19 00:31:23 +01:00
Quentin Guidée
6a55305d52 Merge remote-tracking branch 'upstream/master' into omega-dev 2019-12-15 14:18:36 +01:00
Damien Nicolet
472929c028 External API for KhiCAS 2019-12-13 01:02:14 +01:00
Émilie Feral
070d362f15 [python] Improve comment 2019-12-12 14:16:13 +01:00
Quentin Guidée
f24f7b0603 Merge remote-tracking branch 'upstream/master' into omega-dev 2019-12-06 19:34:28 +01:00
Émilie Feral
49aa58446b [python] modkandinsky: fill_rect and draw_string calls might take some
time. As "micropython_port_vm_hook_loop" is not called while we are
executing module code, we add an extra check for user interruption in
module functions.
2019-12-04 11:27:32 +01:00
Émilie Feral
0db66f1784 [python] Turtle: add TODO 2019-12-04 11:27:32 +01:00
Quentin Guidée
cbb2fb2a19 Merge remote-tracking branch 'upstream/master' into omega-dev 2019-11-19 20:13:56 +01:00
Romain Goyet
7607c4cba4 [python/modion] Use constants to identify keys 2019-11-19 10:08:16 +01:00
Romain Goyet
9d66b23848 [python] Add an ion module 2019-11-19 10:08:16 +01:00
Jean-Baptiste Boric
0971d72cec [python] Implement get_keys in kandinsky 2019-10-11 20:07:51 +02:00
Jean-Baptiste Boric
1d575739bc [python] Implement wait_vblank in kandinsky 2019-10-11 19:50:47 +02:00
Émilie Feral
c0da810ea1 [python] Turtle module: fix modturtle_gc_collect from stack-buffer-overflow 2019-06-14 13:37:11 -04:00
Léa Saviot
e8b3db76b2 [python/turtle] Fix rounding errors
Some horizontal/vertical lines were not properly drawn
Example script:
from math import *
from turtle import *
def a():
  def carre(n):
    fd(n)
    right(90)
    fd(n)
    right(90)
    fd(n)
    right(90)
    fd(n)
    right(90)
  penup()
  goto(-158,109)
  pendown()
  carre(100)
  for j in range(10):
    for i in range(26):
      penup()
      fd(2)
      pendown()
      carre(10)
      penup()
      fd(10)
      pendown()
    penup()
    goto(-158,109-10*(j+1))
    pendown()
2019-05-03 15:53:21 +02:00
Romain Goyet
42f72eee77 [python/kandinsky] draw_string takes two optional colors (text/bg) 2019-04-26 17:44:27 +02:00
Romain Goyet
ec50e75a3a [python/kandinsky] Bubble-up input errors before switching to draw mode 2019-04-26 17:44:27 +02:00
Romain Goyet
926b96cafb [python/kandinsky] Expose the fill_rect method
Which allows for *much* faster graphics
2019-04-26 17:44:27 +02:00
Romain Goyet
bb89ae9211 [python/kandinsky] Color can now be passed as a tuple
The values are expected to be integers between 0 and 255
2019-04-26 17:44:27 +02:00
Léa Saviot
2a34f955ca [python/turtle] Fix some turtle jumps
There was a drawing glitch for instance when doing goto(100,100).
It was due to the tutle mileage being overflowed.
2019-03-12 09:51:40 +01:00
Léa Saviot
ddb22ba1a2 [python/turtle] Fix drawing of diagonal lines 2019-03-12 09:51:40 +01:00
Léa Saviot
147c1b4592 [python/turtle] Make the turtle faster on emscripten
It was slower than on the calculator
2019-03-12 09:51:40 +01:00
Léa Saviot
a036bff275 [python/turtle] Fix setHeadingPrivate (handle big angle errors) 2019-02-11 13:41:10 +01:00
Léa Saviot
3faee8bcd8 [python/turtle] Special case when goTo draws horizontal/vertical line 2019-02-06 11:45:03 +01:00
Léa Saviot
b5e278526f [python/turtle] Use namespace std 2019-02-06 11:45:03 +01:00
Léa Saviot
287dedabc0 [python/turtle] The turtle heading is in [0;360[ 2019-02-06 11:45:03 +01:00
Léa Saviot
a25b2a8ce5 [python/turtle] Fix unwanted dotted lines
Script:
fd(200)
left(90)
fd(10)
left(90)
fd(600)
The final line should be continuous but is dotted
2019-02-06 11:45:03 +01:00
Léa Saviot
5e714c371c [python/turtle] Increase chances that GC collection works fine on turtle 2019-01-21 14:23:38 +01:00
Léa Saviot
2bde26af69 [python/turtle] Specify namespace std when using cos, sin 2019-01-21 13:39:47 +01:00
Léa Saviot
2f9f40f1a7 [python/turtle] Store the heading in degrees with no k_headingOffset
This reduces rouding errors, such as:
setHeading(0)
right(1)
heading() -> gives -1.00...01
2019-01-21 13:39:47 +01:00
Léa Saviot
c2dbe9f7cc [python/turtle] Fix line drawing glitches 2018-12-21 11:57:36 +01:00
Léa Saviot
5a941bc1d5 [python/turtle] Clean circle code 2018-12-21 11:57:09 +01:00
Léa Saviot
4b306791c0 [python/turtle] Turtle::m_drawn is false if sandbox not displayed
This way, Turtle::draw() and erase() are more symetrical and no not
perform themselves if the turtle is already drawn / erased.
2018-12-18 12:05:46 +01:00
Léa Saviot
ad745f7114 [python/turtle] Add speed() methods without args 2018-12-17 15:40:34 +01:00
Léa Saviot
306869edca [python/turtle] Tune values of the turtle speed 2018-12-13 09:44:34 +01:00
Léa Saviot
91c4fea517 [python/turtle] Clean Turtle::PawPosition 2018-12-12 15:45:21 +01:00
Léa Saviot
8ac60983ed [python/turtle] Remove old turtle icon 2018-12-12 15:45:21 +01:00
Léa Saviot
99d71bb0d9 [python/turtle] Clean Turtle::setColor 2018-12-12 15:45:21 +01:00
Léa Saviot
3bd3e64e36 [python/turtle] Order the qstr 2018-12-11 14:42:04 +01:00
Léa Saviot
62cda01d2b [python/turtle] color and pencolor can take various arguments
These two methods are equal.
2018-12-11 14:42:04 +01:00