Skip to content

Commit 9d8ddb5

Browse files
committed
Bugfixes
1 parent ee76942 commit 9d8ddb5

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

src/main/widgets/graph/Graph.cpp

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -513,12 +513,14 @@ namespace lsp
513513

514514
status_t Graph::add(Widget *child)
515515
{
516-
GraphItem *item = widget_cast<GraphItem>(child);
517-
if (item == NULL)
518516
{
519-
GraphEmbed *embed = widget_cast<GraphEmbed>(child);
520-
if (embed == NULL)
521-
return STATUS_BAD_TYPE;
517+
GraphItem *item = widget_cast<GraphItem>(child);
518+
if (item == NULL)
519+
{
520+
GraphEmbed *embed = widget_cast<GraphEmbed>(child);
521+
if (embed == NULL)
522+
return STATUS_BAD_TYPE;
523+
}
522524
}
523525

524526
status_t res = vItems.add(child);
@@ -541,11 +543,17 @@ namespace lsp
541543

542544
status_t Graph::remove(Widget *child)
543545
{
544-
GraphItem *item = widget_cast<GraphItem>(child);
545-
if (item == NULL)
546-
return STATUS_BAD_TYPE;
546+
{
547+
GraphItem *item = widget_cast<GraphItem>(child);
548+
if (item == NULL)
549+
{
550+
GraphEmbed *embed = widget_cast<GraphEmbed>(child);
551+
if (embed == NULL)
552+
return STATUS_BAD_TYPE;
553+
}
554+
}
547555

548-
status_t res = vItems.premove(item);
556+
status_t res = vItems.premove(child);
549557
if (res == STATUS_OK)
550558
{
551559
GraphOrigin *go = widget_cast<GraphOrigin>(child);

src/main/widgets/graph/GraphEmbed.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* along with lsp-tk-lib. If not, see <https://www.gnu.org/licenses/>.
2020
*/
2121

22+
#include <lsp-plug.in/common/debug.h>
2223
#include <lsp-plug.in/tk/tk.h>
2324
#include <private/tk/style/BuiltinStyle.h>
2425

@@ -195,6 +196,8 @@ namespace lsp
195196
rect.nHeight -= rect.nTop;
196197

197198
realize_child(cv, &wrect, &rect);
199+
// lsp_trace("wrect: x=%d, y=%d, w=%d, h=%d", int(wrect.nLeft), int(wrect.nTop), int(wrect.nWidth), int(wrect.nHeight));
200+
198201
ws::ISurface *ws = get_surface(s, wrect.nWidth, wrect.nHeight);
199202
if (ws == NULL)
200203
return;

0 commit comments

Comments
 (0)