Author: mordante
Date: Sat Aug 16 16:51:15 2008
New Revision: 28649
URL: http://svn.gna.org/viewcvs/wesnoth?rev=28649&view=rev
Log:
Hack to make the floating labels work again in the editor, it does fail
in the test scenario since the window there is big and transparent.
Since it's really needed for the editor this hack does suffice.
NOTE there are glitches if the border of the dialog is partial on a label
(same cause which breaks the test scenario).
Modified:
trunk/src/gui/widgets/window.cpp
Modified: trunk/src/gui/widgets/window.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/window.cpp?rev=28649&r1=28648&r2=28649&view=diff
==============================================================================
--- trunk/src/gui/widgets/window.cpp (original)
+++ trunk/src/gui/widgets/window.cpp Sat Aug 16 16:51:15 2008
@@ -159,16 +159,22 @@
need_layout_ = false;
}
-void twindow::draw(surface& surface, const bool force,
+void twindow::draw(surface& surf, const bool force,
const bool invalidate_background)
{
+ // Hack to make the floating labels work again in the editor, it does
fail
+ // in the test scenario since the window there is big and transparent.
+ // Since it's really needed for the editor this hack does suffice.
+ const surface frameBuffer = get_video_surface();
+ font::draw_floating_labels(frameBuffer);
+
const bool draw_foreground = need_layout_ || force;
if(need_layout_) {
DBG_G << "Window: layout client area.\n";
layout(get_client_rect());
canvas(0).draw();
- blit_surface(canvas(0).surf(), 0, surface, 0);
+ blit_surface(canvas(0).surf(), 0, surf, 0);
}
for(tgrid::iterator itor = begin(); itor != end(); ++itor) {
@@ -178,23 +184,24 @@
log_scope2(gui_draw, "Window: draw child.");
- itor->draw(surface, force, invalidate_background);
+ itor->draw(surf, force, invalidate_background);
}
if(draw_foreground) {
canvas(1).draw();
- blit_surface(canvas(1).surf(), 0, surface, 0);
+ blit_surface(canvas(1).surf(), 0, surf, 0);
}
if(tooltip_.is_dirty()) {
- tooltip_.draw(surface);
+ tooltip_.draw(surf);
}
if(help_popup_.is_dirty()) {
- help_popup_.draw(surface);
+ help_popup_.draw(surf);
}
SDL_Rect rect = get_rect();
- SDL_BlitSurface(surface, 0, video_.getSurface(), &rect);
+ SDL_BlitSurface(surf, 0, video_.getSurface(), &rect);
update_rect(get_rect());
set_dirty(false);
+
}
void twindow::flip()
@@ -207,6 +214,8 @@
cursor::draw(frameBuffer);
video_.flip();
cursor::undraw(frameBuffer);
+ // Floating hack part 2.
+ font::undraw_floating_labels(frameBuffer);
}
void twindow::key_press(tevent_handler& /*event_handler*/, bool& handled,
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits