feat: put_pixel #9

Merged
Sweetbread merged 2 commits from kohsine/Core:feature/put_pixel into feat/put_pixel 2024-04-01 12:58:34 +02:00
Contributor

Mini PR to help out my GSoC app a bit and just for funsies.

Mini PR to help out my GSoC app a bit and just for funsies.
kohsine added 1 commit 2024-03-30 23:21:54 +01:00
Sweetbread requested changes 2024-03-31 11:04:27 +02:00
Sweetbread left a comment
Owner

You have a lot of unused imports and button handler. Also, Kolibri's API supports rectangle drawing: #13

You have a lot of unused imports and button handler. Also, Kolibri's API supports rectangle drawing: [#13](https://git.kolibrios.org/KolibriOS/kolibrios/src/branch/main/kernel/branches/Kolibri-A/trunk/docs/sysfuncs.txt#L455-L468)
Sweetbread added the
Kind/Feature
Priority/Low
Status/Need More Info
labels 2024-03-31 11:07:08 +02:00
Author
Contributor

Strange, my rust-analyzer isn't warning me about unused imports. Also didn't know there was a rectangle API. Guess drawing a line would be redundant too then. Would a circle be better then? Or remove the example entirely?

Strange, my rust-analyzer isn't warning me about unused imports. Also didn't know there was a rectangle API. Guess drawing a line would be redundant too then. Would a circle be better then? Or remove the example entirely?
Author
Contributor

The rectangle API can't invert colors though. My example does show the color inversion working.

The rectangle API can't invert colors though. My example does show the color inversion working.
Owner

Strange, my rust-analyzer isn't warning me about unused imports.

изображение

The rectangle API can't invert colors though. My example does show the color inversion working.

Oh, I see. Then can you replace L42-L46 with rectangle drawing? It'll be cool

> Strange, my rust-analyzer isn't warning me about unused imports. ![изображение](/attachments/cfabbf20-b87e-486f-9f0d-951496fa7d43) > The rectangle API can't invert colors though. My example does show the color inversion working. Oh, I see. Then can you replace [L42-L46](https://git.kolibrios.org/Rust/Core/src/commit/27ea16d17128ddddc6521c4e31268f410cd51067/examples/sqr.rs#L42-L46) with rectangle drawing? It'll be cool
Sweetbread reviewed 2024-03-31 23:16:30 +02:00
@ -39,6 +39,12 @@ pub fn define_window(start: Dot, size: Size, params: WindowParams<'_>) {
}
}
pub fn put_pixel(pos: Dot, color: Option<Color>, invert: Option<bool>) {
Owner

And invert's type better to replace with just bool, 'cuz anyway there are 2 options: None or Some(true)

And `invert`'s type better to replace with just bool, 'cuz anyway there are 2 options: `None` or `Some(true)`
Owner

Hm, there are two another options: draw a pixel with given color or invert, so better do inversion if color is null

Hm, there are two another options: draw a pixel with given color or invert, so better do inversion if `color` is null
Author
Contributor

Hm, there are two another options: draw a pixel with given color or invert, so better do inversion if color is null

Ya I like this

> Hm, there are two another options: draw a pixel with given color or invert, so better do inversion if `color` is null Ya I like this
Author
Contributor

Ok let me write a better example. I admit the square example was kind of low effort. I'm thinking a wall of text and a button to invert the colors to show off a kind of basic dark mode.

Ok let me write a better example. I admit the square example was kind of low effort. I'm thinking a wall of text and a button to invert the colors to show off a kind of basic dark mode.
kohsine added 1 commit 2024-04-01 00:46:56 +02:00
Sweetbread changed target branch from master to feat/put_pixel 2024-04-01 12:57:34 +02:00
Sweetbread merged commit 8f52120845 into feat/put_pixel 2024-04-01 12:58:34 +02:00
Sweetbread added
Reviewed/Confirmed
and removed
Status/Need More Info
labels 2024-04-01 12:59:19 +02:00
Sweetbread deleted branch feature/put_pixel 2024-05-27 10:17:10 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Rust/Core#9
No description provided.