30 lines
946 B
C++
30 lines
946 B
C++
/* -----------------------------------------------------------------------------
|
|
GSFramework
|
|
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
|
|
----------------------------------------------------------------------------- */
|
|
|
|
|
|
#include "ui/widget_canvas.h"
|
|
|
|
using namespace GS::S2D;
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
bool CanvasWidget::Allocate(uint width, uint height)
|
|
{
|
|
if (!picture->AllocAs(width, height, GS::PixelFormat::RGBA8))
|
|
return false;
|
|
|
|
dirty = true;
|
|
return true;
|
|
}
|
|
//------------------------------------------------------------------------------
|
|
|
|
//------------------------------------------------------------------------------
|
|
CanvasWidget::CanvasWidget(int id, uint width, uint height) : DrawableWidget(id)
|
|
{
|
|
type = WidgetTypeCanvas;
|
|
picture = new GS::Picture(width, height);
|
|
}
|
|
//------------------------------------------------------------------------------
|