Kaydet (Commit) a66ab02f authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Make thie method consistent with the others.

Change-Id: I028f0dd833cb2307e842805636458f51c71dbd66
üst 4dfd8ba4
...@@ -847,17 +847,22 @@ double VCartesianAxis::getLabelLineIntersectionValue() const ...@@ -847,17 +847,22 @@ double VCartesianAxis::getLabelLineIntersectionValue() const
return getAxisIntersectionValue(); return getAxisIntersectionValue();
} }
bool VCartesianAxis::getLogicValueWhereExtraLineCrossesOtherAxis( double& fCrossesOtherAxis ) const double VCartesianAxis::getExtraLineIntersectionValue() const
{ {
double fNan;
rtl::math::setNan(&fNan);
if( !m_aAxisProperties.m_pfExrtaLinePositionAtOtherAxis ) if( !m_aAxisProperties.m_pfExrtaLinePositionAtOtherAxis )
return false; return fNan;
double fMin = (m_nDimensionIndex==1) ? m_pPosHelper->getLogicMinX() : m_pPosHelper->getLogicMinY(); double fMin = (m_nDimensionIndex==1) ? m_pPosHelper->getLogicMinX() : m_pPosHelper->getLogicMinY();
double fMax = (m_nDimensionIndex==1) ? m_pPosHelper->getLogicMaxX() : m_pPosHelper->getLogicMaxY(); double fMax = (m_nDimensionIndex==1) ? m_pPosHelper->getLogicMaxX() : m_pPosHelper->getLogicMaxY();
if( *m_aAxisProperties.m_pfExrtaLinePositionAtOtherAxis <= fMin if( *m_aAxisProperties.m_pfExrtaLinePositionAtOtherAxis <= fMin
|| *m_aAxisProperties.m_pfExrtaLinePositionAtOtherAxis >= fMax ) || *m_aAxisProperties.m_pfExrtaLinePositionAtOtherAxis >= fMax )
return false; return fNan;
fCrossesOtherAxis = *m_aAxisProperties.m_pfExrtaLinePositionAtOtherAxis;
return true; return *m_aAxisProperties.m_pfExrtaLinePositionAtOtherAxis;
} }
B2DVector VCartesianAxis::getScreenPosition( double fLogicX, double fLogicY, double fLogicZ ) const B2DVector VCartesianAxis::getScreenPosition( double fLogicX, double fLogicY, double fLogicZ ) const
...@@ -1640,8 +1645,8 @@ void VCartesianAxis::createShapes() ...@@ -1640,8 +1645,8 @@ void VCartesianAxis::createShapes()
//create an additional line at NULL //create an additional line at NULL
if( !AxisHelper::isAxisPositioningEnabled() ) if( !AxisHelper::isAxisPositioningEnabled() )
{ {
double fExtraLineCrossesOtherAxis; double fExtraLineCrossesOtherAxis = getExtraLineIntersectionValue();
if( getLogicValueWhereExtraLineCrossesOtherAxis(fExtraLineCrossesOtherAxis) ) if (!rtl::math::isNan(fExtraLineCrossesOtherAxis))
{ {
B2DVector aStart, aEnd; B2DVector aStart, aEnd;
this->get2DAxisMainLine( aStart, aEnd, fExtraLineCrossesOtherAxis ); this->get2DAxisMainLine( aStart, aEnd, fExtraLineCrossesOtherAxis );
......
...@@ -63,7 +63,14 @@ public: ...@@ -63,7 +63,14 @@ public:
*/ */
double getLabelLineIntersectionValue() const; double getLabelLineIntersectionValue() const;
bool getLogicValueWhereExtraLineCrossesOtherAxis( double& fCrossesOtherAxis) const; /**
* Get the value at which extra line crosses the other axis.
*
* @return a NaN if the line doesn't cross the other axis, a non-NaN value
* otherwise.
*/
double getExtraLineIntersectionValue() const;
void get2DAxisMainLine( ::basegfx::B2DVector& rStart, ::basegfx::B2DVector& rEnd, double fCrossesOtherAxis ); void get2DAxisMainLine( ::basegfx::B2DVector& rStart, ::basegfx::B2DVector& rEnd, double fCrossesOtherAxis );
//Layout interface for cartesian axes: //Layout interface for cartesian axes:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment