Add Windows support.

This commit is contained in:
david 2020-07-04 19:43:08 +01:00
parent ee51f3ee09
commit 683ba5447f
37 changed files with 477 additions and 113 deletions

View file

@ -31,14 +31,14 @@ void VerticalSpacer::AddChildLayers(const PaintEvent* event)
mLayers.clear();
double scaleSum = std::accumulate(mScales.begin(), mScales.end(), 0.0);
double offset = 0;
unsigned delta = mSize.mWidth / mChildren.size();
unsigned delta = mSize.mWidth / unsigned(mChildren.size());
for(std::size_t idx=0; idx<mChildren.size(); idx++)
{
auto& child = mChildren[idx];
double scale = mScales[idx];
double delta = mSize.mWidth * (scale/scaleSum);
child->SetBounds(delta, mSize.mHeight);
child->SetLocation(DiscretePoint(mLocation.GetX() + offset, mLocation.GetY()));
child->SetBounds(unsigned(delta), mSize.mHeight);
child->SetLocation(DiscretePoint(mLocation.GetX() + unsigned(offset), mLocation.GetY()));
child->OnPaintEvent(event);
auto layers = child->GetLayers();
mLayers.insert(mLayers.end(), layers.begin(), layers.end());