Skip to content
Commit d8fe02e4 authored by Oliver Kellogg's avatar Oliver Kellogg
Browse files

https://bugs.kde.org/show_bug.cgi?id=449622#c3

> For the load code this would mean there would need to be an extra
> first pass which determines the minimum of all x and the minimum of
> all y values, [...]

umbrello/umlscene.h
- Split static member defaultCanvasSize into the two static members
  s_defaultCanvasWidth and s_defaultCanvasHeight for finer control.
- At static member m_showDocumentationIndicator change prefix from "m_"
  to "s_" for symmetry with other static members.
- New members m_minX, m_minY, m_maxX, m_maxY gather data used for
  estimating required canvas size. They are filled during loadFromXMI().
- New members m_fixX and m_fixY are used for compensating for undue
  offsets of x/y values in previous version XMI files.
  Further, the QGraphicsScene coordinate system is changed to originate
  at x/y position (0,0).
  This means there are no longer negative values for x/y coordinates.
- New function updateCanvasSizeEstimate is called during loadFromXMI()
  of the individual widgets. The members m_minX, m_minY, m_maxX, m_maxY
  may be updated by the arguments x, y, w, h.
- New getters fixX() and fixY() return m_fixX and m_fixY, respectively.
  They are called from the loadFromXMI functions of individual widgets.

umbrello/umlscene.cpp
- In function loadFromXMI :
  - Parse attributes "canvaswidth" and "canvasheight" into qreals
    canvasWidth and canvasHeight but leave their value at 0.0 if the XML
    attribute values are implausible.
  - Before the loop which loads widgets from XMI add a loop which only
    parses the x and y values of the widgets and sets variables
    xNegOffset, yNegOffset, xPosOffset, yPosOffset to the minimum resp.
    maximum values encountered. After end of loop the members m_fixX and
    m_fixY may be altered depending on the [xy]{Neg,Pos}Offset values.
  - After the widget-load loop, if the calculated m_maxX, m_maxY exceed
    canvasWidth or canvasHeight then call setSceneRect with arguments
    x=0, y=0, w=m_maxX, h=m_maxY.

umbrello/umlwidgets/umlwidget.cpp
- In function loadFromXMI :
  - Local qreals nX, nY receive result of toDoubleFromAnyLocale(x) and
    toDoubleFromAnyLocale(y) respectively.
  - Local qreals fixedX, fixedY receive result of nX+umlScene()->fixX()
    and nY + umlScene()->fixY().
  - Local qreals scaledX, scaledY receive result of fixedX * dpiScale
    and fixedY * dpiScale.
  - Add call to umlScene()->updateCanvasSizeEstimate() with arguments
    scaledX, scaledY, scaledW, scaledH.

umbrello/umlwidgets/associationline.cpp
- In function loadFromXMI, on initializing nX add umlScene->fixX() and
  on initializing nY add umlScene->fixY().

CCBUG: 449622
parent edf7206b
Loading
Loading
Loading
Pipeline #136088 passed with stage
in 19 minutes and 6 seconds
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment