Jump to content

[SOLVED] WidgetCanvas's polygons disappear when they don't have to


photo

Recommended Posts

Hi! I use WidgetCanvas to create outlines like in tables. I also use WidgetScrollBox (to scroll table). So, the problem is: when one point of a polygon leaves visible area in scrollbox the whole polygon disappears. Is there any workaround? Or maybe I use canvas in a wrong way.. I've attached example code (when scrolling down very slowly you can notice that upper polygon disappears though it still has to be in its place).

Also I found out that Gui::CHANGED callback for scrollbox works only when mouse is pressed onto scrolls. How can I detect using only mouse wheel?

source.7z

Link to comment

I'm trying to create a table class like in MS Excel (not through .ui but through C++ API). So the main idea is to create a container for widgets and draw borders around it. And I also need to scroll through this table (vertical and horizontal scrolls, example below).

image.thumb.png.e1dbb7500613371000796fb17ad900c7.png

I need it as soon as possible...

Edited by naumova.natalya
Link to comment

We've taken another look at this.

 

1. You can fix disappearing canvas polygon by deleting or commenting the following string: 

canvas->setPosition(10, 10);

2. Detecting mouse wheel can be done manually, by imitating a callback, for instance:

if (App::get()->getMouseAxis(App::AXIS_Y) != 0) {
   // Do something...
}

Then check if scrollbar position was changed in the same AppWorldLogic::update():

	if (scrollbox->getHScrollValue() != old_hscroll || scrollbox->getVScrollValue() != old_vscroll)
	{
		// Do something...
	}
	old_hscroll = scrollbox->getHScrollValue();
	old_vscroll = scrollbox->getVScrollValue();

Please, let us know if this works for you.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
  • morbid changed the title to [SOLVED] WidgetCanvas's polygons disappear when they don't have to
×
×
  • Create New...