Exemplo n.º 1
0
void CommandObjectBase::press()
{
    const auto& current = m_presenter->model();

    // Serialize the current state of the curve
    m_startSegments = current.toCurveData();

    // To prevent behind locked at 0.000001 or 0.9999
    m_xmin = -1;
    m_xmax = 2;

    on_press();
}
void CurveCommandObjectBase::press()
{
    const auto& current = m_presenter->model()->segments();

    // Serialize the current state of the curve
    m_startSegments.clear();
    m_startSegments.resize(current.size());
    int i = 0;
    for(const auto& segment : current)
    {
        Serializer<DataStream> s{&m_startSegments[i++]};
        s.readFrom(*segment);
    }

    m_xmin = 0;
    m_xmax = 1;

    on_press();
}