From c01acc6678e6ec7a3e11fe89d4d4cd83c72b3e86 Mon Sep 17 00:00:00 2001 From: Erik Corry Date: Mon, 11 Dec 2023 12:41:21 +0100 Subject: [PATCH] Kebabify comments (#69) * Kebabify comments * feedback --- src/common.toit | 8 ++++---- src/one_byte.toit | 2 +- src/pixel_display.toit | 2 +- src/style.toit | 2 +- src/true_color.toit | 4 ++-- tests/gradient_bounds_visualized.toit | 2 +- tests/style_test.toit | 8 ++++---- tests/toit-png-tools | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/common.toit b/src/common.toit index 41cbfaf..5c3e7d6 100644 --- a/src/common.toit +++ b/src/common.toit @@ -231,8 +231,8 @@ abstract class Canvas: If the $palette argument is shorter than the highest index in the pixmap, then pixels with high indices are assumed to be gray-scale with the index representing the gray value (white = 0xff). - The $orientation argument can be ORIENTATION_0, ORIENTATION_90, - ORIENTATION_180, or ORIENTATION_270, from "import bitmap", + The $orientation argument can be $ORIENTATION-0, $ORIENTATION-90, + $ORIENTATION-180, or $ORIENTATION-270, from "import bitmap", representing anti-clockwise rotation of the drawn pixmap. Using $source-line-stride a number of bytes can be skipped at the end of each line. This is useful if the pixmap is padded, or @@ -254,8 +254,8 @@ abstract class Canvas: the red, green, or blue component of the pixel. The order of the pixmap is as in PNG, so the lines are ordered from top to bottom, and within each line the bytes are ordered from left to right. - The $orientation argument can be ORIENTATION_0, ORIENTATION_90, - ORIENTATION_180, or ORIENTATION_270, from "import bitmap", + The $orientation argument can be $ORIENTATION-0, $ORIENTATION-90, + $ORIENTATION-180, or $ORIENTATION-270, from "import bitmap", representing anti-clockwise rotation of the drawn pixmap. This method is only available on true-color canvases. */ diff --git a/src/one_byte.toit b/src/one_byte.toit index 0ca1e01..24911eb 100644 --- a/src/one_byte.toit +++ b/src/one_byte.toit @@ -78,7 +78,7 @@ abstract class OneByteCanvas_ extends Canvas: return // Unfortunately one of the alpha values is not 0 or 0xff, so we can't use // the bitmap draw primitive. We can blow it up to bytes, then use the - // bitmap_draw_bytemap. + // bitmap-draw-bytemap. h := (pixels.size + source-line-stride - source-byte-width ) / source-line-stride bytemap := ByteArray source-width * h bitmap-draw-bitmap 0 0 diff --git a/src/pixel_display.toit b/src/pixel_display.toit index 6cd7936..85edc22 100644 --- a/src/pixel_display.toit +++ b/src/pixel_display.toit @@ -79,7 +79,7 @@ abstract class PixelDisplay implements Window: inner-height: return driver_.width // Need-to-redraw is tracked as a bit array of dirty bits, arranged in - // SSD1306 layout so we can use bitmap_rectangle to invalidate areas. + // SSD1306 layout so we can use bitmap-rectangle to invalidate areas. // One bit in the dirty map covers an area of 8x8 pixels of the display. static CLEAN_ ::= 0 static DIRTY_ ::= 1 diff --git a/src/style.toit b/src/style.toit index 3d4d003..bf3e83b 100644 --- a/src/style.toit +++ b/src/style.toit @@ -416,7 +416,7 @@ class RoundedCornerOpacity_: return new static TABLE-SIZE_/int ::= 256 - // The heights of a top-right quarter circle of radius [TABLE_SIZE_]. + // The heights of a top-right quarter circle of radius [TABLE-SIZE_]. static QUARTER-CIRCLE_/ByteArray ::= create-quarter-circle-array_ TABLE-SIZE_ static create-quarter-circle-array_ size -> ByteArray: diff --git a/src/true_color.toit b/src/true_color.toit index 355ad0b..af281e1 100644 --- a/src/true_color.toit +++ b/src/true_color.toit @@ -62,7 +62,7 @@ class Canvas_ extends Canvas: super width height stringify: - return "true_color.Canvas_ $(width_)x$height_" + return "true-color.Canvas_ $(width_)x$height_" set-all-pixels color/int -> none: bytemap-zap red_ (red-component color) @@ -143,7 +143,7 @@ class Canvas_ extends Canvas: return // Unfortunately one of the alpha values is not 0 or 0xff, so we can't use // the bitmap draw primitive. We can blow it up to bytes, then use the - // bitmap_draw_bytemap. + // bitmap-draw-bytemap. h := (pixels.size + source-line-stride - source-byte-width) / source-line-stride bytemap := ByteArray source-width * h bitmap-draw-bitmap 0 0 diff --git a/tests/gradient_bounds_visualized.toit b/tests/gradient_bounds_visualized.toit index 85db80c..6be5b92 100644 --- a/tests/gradient_bounds_visualized.toit +++ b/tests/gradient_bounds_visualized.toit @@ -53,7 +53,7 @@ main args: display.draw - // Rotate all gradient_elements 30 degrees. + // Rotate all gradient-elements 30 degrees. angle := 30 gradient-elements.do: it.background = GradientBackground --angle=angle --specifiers=it.background.specifiers diff --git a/tests/style_test.toit b/tests/style_test.toit index da7b144..0714652 100644 --- a/tests/style_test.toit +++ b/tests/style_test.toit @@ -42,8 +42,8 @@ toit-doc-examples-test: "fish-or-fowl": Style --color=0xffffff --background=0x606060, } -/// Test a literal element tree can be constructed and get_element_by_id can be -/// used to find a named element. +/// Test a literal element tree can be constructed and +/// $Element.get-element-by-id can be used to find a named element. element-tree-test: elements := Div [ Square --id="first-square", @@ -53,8 +53,8 @@ element-tree-test: first := elements.get-element-by-id "first-square" expect first.id == "first-square" -/// Test that we can use set_styles to distribute the styles to all the -/// elements. +/// Test that we can use $Element.set-styles to distribute the styles to all +/// the elements. combine-test: elements := Div [ Div --id="special" [ diff --git a/tests/toit-png-tools b/tests/toit-png-tools index 8387669..ee472ac 160000 --- a/tests/toit-png-tools +++ b/tests/toit-png-tools @@ -1 +1 @@ -Subproject commit 8387669efa33a7108c746dcb19dd5ad0ac8f89d0 +Subproject commit ee472ac9d4333a138206f9d3a817d3c5432d6f87