|
1 |
| -#include "tophat.h" |
| 1 | +#include "tophat.h" |
2 | 2 | const char *th_em_modulesrc[] = {
|
3 | 3 | "\n"
|
4 | 4 | "import (\n"
|
@@ -534,7 +534,9 @@ const char *th_em_modulesrc[] = {
|
534 | 534 | "\n"
|
535 | 535 | "fn umth_image_render_target_to_image(ret: ^Image, rt: RenderTarget)\n"
|
536 | 536 | "//~~fn RenderTarget.toImage\n"
|
537 |
| -"// Returns the image of the render target.\n" |
| 537 | +"// Returns the image of the render target. The resulting image has the same\n" |
| 538 | +"// lifetime as the base RenderTarget. If you need to use it past the lifetime\n" |
| 539 | +"// of the RenderTarget, use the copy method.\n" |
538 | 540 | "// Do not call `setfilter` on the resulting image.\n"
|
539 | 541 | "fn (rt: ^RenderTarget) toImage*(): Image {\n"
|
540 | 542 | "//~~\n"
|
@@ -3720,6 +3722,13 @@ const char *th_em_modulesrc[] = {
|
3720 | 3722 | "\t\t}\n"
|
3721 | 3723 | "\n"
|
3722 | 3724 | "\t\trunes := utf8.decode(input.getStr())\n"
|
| 3725 | +"\t\tfor i:=0; i < len(runes); i++ {\n" |
| 3726 | +"\t\t\tif runes[i] < 32 {\n" |
| 3727 | +"\t\t\t\trunes = delete(runes, i)\n" |
| 3728 | +"\t\t\t\ti--\n" |
| 3729 | +"\t\t\t}\n" |
| 3730 | +"\t\t}\n" |
| 3731 | +"\n" |
3723 | 3732 | "\t\tif len(runes) > 0 && v {\n"
|
3724 | 3733 | "\t\t\ttb.buffer = append(append(slice(tb.buffer, 0, tb.cursor), runes), slice(tb.buffer, tb.cursor))\n"
|
3725 | 3734 | "\t\t\ttb.cursor += len(runes)\n"
|
@@ -4251,7 +4260,9 @@ const char *th_em_moduledocs[] = {
|
4251 | 4260 | "fn (rt: ^RenderTarget) toImage*(): Image {\n"
|
4252 | 4261 | "```\n"
|
4253 | 4262 | "\n"
|
4254 |
| -"Returns the image of the render target.\n" |
| 4263 | +"Returns the image of the render target. The resulting image has the same\n" |
| 4264 | +"lifetime as the base RenderTarget. If you need to use it past the lifetime\n" |
| 4265 | +"of the RenderTarget, use the copy method.\n" |
4255 | 4266 | "Do not call `setfilter` on the resulting image.\n"
|
4256 | 4267 | "\n"
|
4257 | 4268 | "\n"
|
|
0 commit comments