Formatting review
This commit is contained in:
parent
2efb50cc63
commit
7f2a071c51
4 changed files with 29 additions and 25 deletions
17
src/core.c
17
src/core.c
|
@ -5102,17 +5102,20 @@ static void ErrorCallback(int error, const char *description)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "GLFW: Error: %i Description: %s", error, description);
|
TRACELOG(LOG_WARNING, "GLFW: Error: %i Description: %s", error, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PLATFORM_WEB)
|
#if defined(PLATFORM_WEB)
|
||||||
EM_JS(int, CanvasGetWidth, (), { return canvas.clientWidth; });
|
EM_JS(int, GetCanvasWidth, (), { return canvas.clientWidth; });
|
||||||
EM_JS(int, CanvasGetHeight, (), { return canvas.clientHeight; });
|
EM_JS(int, GetCanvasHeight, (), { return canvas.clientHeight; });
|
||||||
|
|
||||||
static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *e, void *userData)
|
static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *e, void *userData)
|
||||||
{
|
{
|
||||||
// Don't resize non-resizeable windows
|
// Don't resize non-resizeable windows
|
||||||
if ((CORE.Window.flags & FLAG_WINDOW_RESIZABLE) == 0) return true;
|
if ((CORE.Window.flags & FLAG_WINDOW_RESIZABLE) == 0) return true;
|
||||||
// This event is called whenever the window changes sizes, so the size of
|
|
||||||
// the canvas object is explicitly retrieved below
|
// This event is called whenever the window changes sizes,
|
||||||
int width = CanvasGetWidth();
|
// so the size of the canvas object is explicitly retrieved below
|
||||||
int height = CanvasGetHeight();
|
int width = GetCanvasWidth();
|
||||||
|
int height = GetCanvasHeight();
|
||||||
emscripten_set_canvas_element_size("#canvas",width,height);
|
emscripten_set_canvas_element_size("#canvas",width,height);
|
||||||
|
|
||||||
SetupViewport(width, height); // Reset viewport and projection matrix for new size
|
SetupViewport(width, height); // Reset viewport and projection matrix for new size
|
||||||
|
@ -5126,9 +5129,11 @@ static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *
|
||||||
// Set current screen size
|
// Set current screen size
|
||||||
CORE.Window.screen.width = width;
|
CORE.Window.screen.width = width;
|
||||||
CORE.Window.screen.height = height;
|
CORE.Window.screen.height = height;
|
||||||
|
|
||||||
// NOTE: Postprocessing texture is not scaled to new size
|
// NOTE: Postprocessing texture is not scaled to new size
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// GLFW3 WindowSize Callback, runs when window is resizedLastFrame
|
// GLFW3 WindowSize Callback, runs when window is resizedLastFrame
|
||||||
// NOTE: Window resizing not allowed by default
|
// NOTE: Window resizing not allowed by default
|
||||||
static void WindowSizeCallback(GLFWwindow *window, int width, int height)
|
static void WindowSizeCallback(GLFWwindow *window, int width, int height)
|
||||||
|
|
|
@ -931,8 +931,7 @@ void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, f
|
||||||
{
|
{
|
||||||
glyphWidth = (font.chars[index].advanceX == 0) ? font.recs[index].width*scaleFactor : font.chars[index].advanceX*scaleFactor;
|
glyphWidth = (font.chars[index].advanceX == 0) ? font.recs[index].width*scaleFactor : font.chars[index].advanceX*scaleFactor;
|
||||||
|
|
||||||
if (i + 1 < length)
|
if (i + 1 < length) glyphWidth = glyphWidth + spacing;
|
||||||
glyphWidth = glyphWidth + spacing;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: When wordWrap is ON we first measure how much of the text we can draw before going outside of the rec container
|
// NOTE: When wordWrap is ON we first measure how much of the text we can draw before going outside of the rec container
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue