Skip to content

Commit

Permalink
fix spelling errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mmertama committed Mar 17, 2024
1 parent 8f5147b commit 3660d60
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gempyre is a library that is linked with the application, except for Android, se
### Gempyre API

* gempyre.h, core classes for the application development.
* gempyre_utils.h, miscellaneous collection of helper functions. These are not available for Python as there are plenty of analogous fuctionality.
* gempyre_utils.h, miscellaneous collection of helper functions. These are not available for Python as there are plenty of analogous functionality.
* gempyre_graphics.h, HTML canvas functions for bitmap and vector graphics.
* gempyre_client.h, file dialogs for Gempyre application. Not available when system browser is used as an application window.

Expand Down Expand Up @@ -94,10 +94,10 @@ A: Try `Ui::eval()`, it let you execute javascript in the gui context: e.g. Here
ui.eval("document.getElementById(\"" + check_box.id() + "\").click();");
```
Q: Why Canvas drawings seems to happen in random order?</br>
A: Canvas drawing is highly asynchronous operation and subsequent `CanvasElement::draw()` operations may not get updated in the order you have called them. The solution is either make a single draw call where all items are updated once, or use `CanvasElement::draw_completed()` to wait until each draw has happen. `CanvaElement::draw_completed()` should be used for animations (or game like frequent updates) instead of timers for updating the graphics. Like this [example](https://github.com/mmertama/Gempyre/blob/6ef49c831c39f8dd67a0cd656f26dae4a2ff46e0/examples/fire/src/main.cpp#L100)
A: Canvas drawing is highly asynchronous operation and subsequent `CanvasElement::draw()` operations may not get updated in the order you have called them. The solution is either make a single draw call where all items are updated once, or use `CanvasElement::draw_completed()` to wait until each draw has happen. `CanvasElement::draw_completed()` should be used for animations (or game like frequent updates) instead of timers for updating the graphics. Like this [example](https://github.com/mmertama/Gempyre/blob/6ef49c831c39f8dd67a0cd656f26dae4a2ff46e0/examples/fire/src/main.cpp#L100)

Q: Why `Gempyre::Bitmap` merge is not working?</br>
A: You are likely mergin on uninitialized bitmap. `Gempyre::Bitmap(width, height)` or `Gempyre::Bitmap::create(width, height)` does not initialize bitmap data, therefore it's alpha channel can be zero and bitmap
A: You are likely merge an uninitialized bitmap. `Gempyre::Bitmap(width, height)` or `Gempyre::Bitmap::create(width, height)` does not initialize bitmap data, therefore it's alpha channel can be zero and bitmap
is not drawn. To initialize the bitmap, use `Gempyre::Bitmap::Bitmap(0, 0, width, height, Gempyre::Color::White)`, or draw a rectangle to fill the Bitmap, after the construction.

Q: How to scale `Gempyre::Bitmap`?</br>
Expand Down Expand Up @@ -134,7 +134,7 @@ const auto texture_draw = [&ui, &texture_images, image_key, clip, rect]() {
```
Q: How to do multiple `Gempyre::FrameComposer` in a single draw? My second draw is not visible</br>
A: Do you call erase? See `GempyreCanvas::draw_completed above. You may also try to call your drawn in a `Ui::after` timer with 0ms delay, that should ensure the correct drawing order.
A: Do you call erase? See `CanvasElement::draw_completed above. You may also try to call your drawn in a `Ui::after` timer with 0ms delay, that should ensure the correct drawing order.
Q: Why my dynamic HTML `<select>` does not work with numbers?</br>
A: The UI select uses strings, and hence the values has to be _quoted_ strings.
Expand All @@ -149,7 +149,7 @@ A: The UI select uses strings, and hence the values has to be _quoted_ strings.
// dynamical add items numerical keys
for(const int value : tag_keys) {
Gempyre::Element opt{ui, "option", show_tags};
const auto value = std::to_string(value); // make numve as a string
const auto value = std::to_string(value); // number as a string
opt.set_attribute("value", GempyreUtils::qq(value)); // The numerical values must be quoted, otherwise JS interpret them as numbers!
opt.set_attribute("name", "tag_option");
opt.set_html(value);
Expand Down
9 changes: 8 additions & 1 deletion aspell/gempyre_words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,11 @@ getElementById
gui
programmatically
pywebview
wp
wp
substr
ltrim
rtrim
rbegin
pacman
fc
emplace
3 changes: 2 additions & 1 deletion gempyrelib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ if(DOXYGEN)
.git
js
py
examples)
examples
cmake-build-debug)
add_spellcheck(${PROJECT_NAME})
endif()
endif()
Expand Down
2 changes: 2 additions & 0 deletions gempyrelib/cmake/libwebsockets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,5 @@ set(GEMPYRE_WS_SOURCES
src/libwebsockets/lws_server.h
)

set(WEBSOCKET_LIBRARY_NAME "libwebsocket")

6 changes: 3 additions & 3 deletions gempyrelib/include/gempyre.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ namespace Gempyre {
bool add_file(const std::string& url, const std::string& file);

/// @brief Add a data into Gempyre to be accessed via url.
/// @param url tring bound to data.
/// @param data dat to write.
/// @param url string bound to data.
/// @param data data to write.
/// @return
bool add_data(const std::string& url, const std::vector<uint8_t>& data);

Expand Down Expand Up @@ -451,7 +451,7 @@ namespace Gempyre {
/// Read list files as a maps
static Ui::Filemap to_file_map(const std::vector<std::string>& filenames);

/// Write pending requets to UI - e.g. when eventloop thread is blocked.
/// Write pending requests to UI - e.g. when eventloop thread is blocked.
void flush();

/// test if Element can be accessed. Note that in false it's may be in HTML, but not available in DOM tree.
Expand Down
4 changes: 2 additions & 2 deletions gempyrelib/include/gempyre_graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ namespace Color {
/// @brief Bitmap for Gempyre Graphics
class GEMPYRE_EX Bitmap {
public:
/// @brief Constructor - unitialialized data
/// @brief Constructor - uninitialized data
/// @param width
/// @param height
Bitmap(int width, int height);
Expand Down Expand Up @@ -350,7 +350,7 @@ class GEMPYRE_EX Bitmap {
void tile(int x, int y, const Bitmap& other, int width, int height);

/// Draw a Bitmap withing extents on this bitmap - replace area.
void tile(int x, int y, const Bitmap& other, int rx, int ry, int width, int height);
void tile(int x, int y, const Bitmap& other, int other_x, int other_y, int width, int height);

/// Create a new bitmap from part of bitmap
Bitmap clip(const Element::Rect& rect) const;
Expand Down

0 comments on commit 3660d60

Please sign in to comment.