Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a14260a

Browse filesBrowse files
committed
fix: the first page is not drawn
1 parent 456b4f5 commit a14260a
Copy full SHA for a14260a

File tree

Expand file treeCollapse file tree

2 files changed

+7
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-3
lines changed

‎src/widget/html_widget.cpp

Copy file name to clipboardExpand all lines: src/widget/html_widget.cpp
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ void html_widget::size_allocate_vfunc(int width, int height, int /* baseline */)
423423
queue_draw();
424424
} else
425425
{
426+
m_draw_buffer.on_size_allocate(page, width, height);
426427
m_rendered_width = width;
427428
}
428429

@@ -589,7 +590,7 @@ void html_widget::on_page_loaded(uint64_t web_page_id)
589590
update_view_port(m_current_page);
590591
}
591592
scroll_to(0, 0);
592-
queue_draw();
593+
on_redraw();
593594
m_sig_set_address.emit(url);
594595
m_sig_update_state.emit(get_state());
595596
}

‎src/widget/html_widget.h

Copy file name to clipboardExpand all lines: src/widget/html_widget.h
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ class draw_buffer
336336

337337
void redraw_area(std::shared_ptr<litebrowser::web_page> page, int x, int y, int width, int height)
338338
{
339-
if(page && m_draw_buffer)
339+
if(m_draw_buffer)
340340
{
341341
// Calculate scaled position
342342
int s_x = std::floor((double) (x - m_left) * m_scale_factor);
@@ -359,7 +359,10 @@ class draw_buffer
359359
cairo_scale(cr, m_scale_factor, m_scale_factor);
360360

361361
// Draw page
362-
page->draw((litehtml::uint_ptr) cr, -m_left, -m_top, &pos);
362+
if(page)
363+
{
364+
page->draw((litehtml::uint_ptr) cr, -m_left, -m_top, &pos);
365+
}
363366

364367
cairo_destroy(cr);
365368
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.