pxt-common-packages 9.3.12 → 9.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P181457(s) {
59
+ function _main___P181498(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___181698 = (undefined);
70
- globals._pollEventQueue___181711 = (undefined);
69
+ globals._intervals___181739 = (undefined);
70
+ globals._pollEventQueue___181752 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P181457.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"targetoverrides.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P181457.continuations = [ ]
75
+ _main___P181498.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"targetoverrides.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P181498.continuations = [ ]
77
77
 
78
- function _main___P181457_mk(s) {
78
+ function _main___P181498_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P181457, depth: s.depth + 1,
81
+ parent: s, fn: _main___P181498, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P181457_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P181457
91
+ return _main___P181498
92
92
  })
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P183277(s) {
59
+ function _main___P183318(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___183518 = (undefined);
70
- globals._pollEventQueue___183531 = (undefined);
69
+ globals._intervals___183559 = (undefined);
70
+ globals._pollEventQueue___183572 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P183277.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"radio-broadcast.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P183277.continuations = [ ]
75
+ _main___P183318.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"radio-broadcast.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P183318.continuations = [ ]
77
77
 
78
- function _main___P183277_mk(s) {
78
+ function _main___P183318_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P183277, depth: s.depth + 1,
81
+ parent: s, fn: _main___P183318, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P183277_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P183277
91
+ return _main___P183318
92
92
  })
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
56
56
  const pxsim_numops = pxsim.numops;
57
57
 
58
58
 
59
- function _main___P165361(s) {
59
+ function _main___P165402(s) {
60
60
  let r0 = s.r0, step = s.pc;
61
61
  s.pc = -1;
62
62
 
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
66
66
  switch (step) {
67
67
  case 0:
68
68
 
69
- globals._intervals___165602 = (undefined);
70
- globals._pollEventQueue___165615 = (undefined);
69
+ globals._intervals___165643 = (undefined);
70
+ globals._pollEventQueue___165656 = (undefined);
71
71
  r0 = undefined;
72
72
  return leave(s, r0)
73
73
  default: oops()
74
74
  } } }
75
- _main___P165361.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"targetoverrides.ts","functionName":"<main>","argumentNames":[]}
76
- _main___P165361.continuations = [ ]
75
+ _main___P165402.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"targetoverrides.ts","functionName":"<main>","argumentNames":[]}
76
+ _main___P165402.continuations = [ ]
77
77
 
78
- function _main___P165361_mk(s) {
78
+ function _main___P165402_mk(s) {
79
79
  checkStack(s.depth);
80
80
  return {
81
- parent: s, fn: _main___P165361, depth: s.depth + 1,
81
+ parent: s, fn: _main___P165402, depth: s.depth + 1,
82
82
  pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
83
83
  } }
84
84
 
@@ -88,5 +88,5 @@ function _main___P165361_mk(s) {
88
88
 
89
89
  const breakpoints = setupDebugger(1, [])
90
90
 
91
- return _main___P165361
91
+ return _main___P165402
92
92
  })
@@ -1086,19 +1086,21 @@ void blit(Image_ dst, Image_ src, pxt::RefCollection *args) {
1086
1086
  int hSrc = pxt::toInt(args->getAt(7));
1087
1087
  bool transparent = pxt::toBoolQuick(args->getAt(8));
1088
1088
 
1089
- int xDstStart = max(0, xDst);
1090
- int yDstStart = max(0, yDst);
1089
+ int xSrcStep = (wSrc << 16) / wDst;
1090
+ int ySrcStep = (hSrc << 16) / hDst;
1091
+
1092
+ int xDstClip = abs(min(0, xDst));
1093
+ int yDstClip = abs(min(0, yDst));
1094
+ int xDstStart = xDst + xDstClip;
1095
+ int yDstStart = yDst + yDstClip;
1091
1096
  int xDstEnd = min(dst->width(), xDst + wDst);
1092
1097
  int yDstEnd = min(dst->height(), yDst + hDst);
1093
1098
 
1094
- int xSrcStart = max(0, xSrc) << 16;
1095
- int ySrcStart = max(0, ySrc) << 16;
1099
+ int xSrcStart = max(0, (xSrc << 16) + xDstClip * xSrcStep);
1100
+ int ySrcStart = max(0, (ySrc << 16) + yDstClip * ySrcStep);
1096
1101
  int xSrcEnd = min(src->width(), xSrc + wSrc) << 16;
1097
1102
  int ySrcEnd = min(src->height(), ySrc + hSrc) << 16;
1098
1103
 
1099
- int xSrcStep = (wSrc << 16) / wDst;
1100
- int ySrcStep = (hSrc << 16) / hDst;
1101
-
1102
1104
  dst->makeWritable();
1103
1105
 
1104
1106
  for (int yDstCur = yDstStart, ySrcCur = ySrcStart; yDstCur < yDstEnd && ySrcCur < ySrcEnd; ++yDstCur, ySrcCur += ySrcStep) {
@@ -654,19 +654,21 @@ namespace pxsim.ImageMethods {
654
654
  const hSrc = args.getAt(7) as number;
655
655
  const transparent = args.getAt(8) as number;
656
656
 
657
- const xDstStart = Math.max(0, xDst);
658
- const yDstStart = Math.max(0, yDst);
657
+ const xSrcStep = ((wSrc << 16) / wDst) | 0;
658
+ const ySrcStep = ((hSrc << 16) / hDst) | 0;
659
+
660
+ const xDstClip = Math.abs(Math.min(0, xDst));
661
+ const yDstClip = Math.abs(Math.min(0, yDst));
662
+ const xDstStart = xDst + xDstClip;
663
+ const yDstStart = yDst + yDstClip;
659
664
  const xDstEnd = Math.min(dst._width, xDst + wDst);
660
665
  const yDstEnd = Math.min(dst._height, yDst + hDst);
661
666
 
662
- const xSrcStart = Math.max(0, xSrc) << 16;
663
- const ySrcStart = Math.max(0, ySrc) << 16;
667
+ const xSrcStart = Math.max(0, (xSrc << 16) + xDstClip * xSrcStep);
668
+ const ySrcStart = Math.max(0, (ySrc << 16) + yDstClip * ySrcStep);
664
669
  const xSrcEnd = Math.min(src._width, xSrc + wSrc) << 16;
665
670
  const ySrcEnd = Math.min(src._height, ySrc + hSrc) << 16;
666
671
 
667
- const xSrcStep = ((wSrc << 16) / wDst) | 0;
668
- const ySrcStep = ((hSrc << 16) / hDst) | 0;
669
-
670
672
  for (let yDstCur = yDstStart, ySrcCur = ySrcStart; yDstCur < yDstEnd && ySrcCur < ySrcEnd; ++yDstCur, ySrcCur += ySrcStep) {
671
673
  const ySrcCurI = ySrcCur >> 16;
672
674
  for (let xDstCur = xDstStart, xSrcCur = xSrcStart; xDstCur < xDstEnd && xSrcCur < xSrcEnd; ++xDstCur, xSrcCur += xSrcStep) {