|
From: CVS C. to T. <the...@li...> - 2012-02-28 22:12:32
|
Revision: 682
http://themis.svn.sourceforge.net/themis/?rev=682&view=rev
Author: mark_hellegers
Date: 2012-02-28 22:12:26 +0000 (Tue, 28 Feb 2012)
Log Message:
-----------
Fixed the vertical sizing of table cells relative to each other in a row.
Modified Paths:
--------------
trunk/themis/modules/CSSRenderer/CSSView.cpp
trunk/themis/modules/CSSRenderer/CSSView.hpp
trunk/themis/modules/CSSRenderer/TableRowDisplayView.cpp
Modified: trunk/themis/modules/CSSRenderer/CSSView.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/CSSView.cpp 2012-02-28 20:12:04 UTC (rev 681)
+++ trunk/themis/modules/CSSRenderer/CSSView.cpp 2012-02-28 22:12:26 UTC (rev 682)
@@ -103,6 +103,7 @@
mListStyleType = "none";
mName = mNode->getNodeName();
mRequestedWidth = -1;
+ mRequestedHeight = -1;
if (mNode->hasChildNodes()) {
TNodeListPtr children = mNode->getChildNodes();
@@ -791,6 +792,11 @@
mRects.push_back(mRect);
// mRect.PrintToStream();
}
+
+ // Enforce the requested height if set
+ if (mRequestedHeight > -1) {
+ mRect.bottom = mRect.top + mRequestedHeight;
+ }
// Add any margins
mEndPoint.Set(mEndPoint.x + mMarginRight, mEndPoint.y + mMarginBottom);
@@ -874,6 +880,12 @@
}
+void CSSView :: SetHeight(float aHeight) {
+
+ mRequestedHeight = aHeight;
+
+}
+
float CSSView :: GetChildWidth(unsigned int aIndex) {
float result = 0;
Modified: trunk/themis/modules/CSSRenderer/CSSView.hpp
===================================================================
--- trunk/themis/modules/CSSRenderer/CSSView.hpp 2012-02-28 20:12:04 UTC (rev 681)
+++ trunk/themis/modules/CSSRenderer/CSSView.hpp 2012-02-28 22:12:26 UTC (rev 682)
@@ -103,6 +103,7 @@
bool mDisplay;
bool mBlock;
float mRequestedWidth;
+ float mRequestedHeight;
void ApplyStyle(const TElementPtr aElement,
const CSSStyleDeclarationPtr aStyle);
@@ -130,7 +131,8 @@
BPoint aStartingPoint);
void SplitText();
void RetrieveResources();
- void SetWidth(float aRequestedWidth);
+ void SetWidth(float aWidth);
+ void SetHeight(float aHeight);
float GetChildWidth(unsigned int aIndex);
void SetChildWidth(float aWidth, unsigned int aIndex);
unsigned int GetLength() const;
Modified: trunk/themis/modules/CSSRenderer/TableRowDisplayView.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/TableRowDisplayView.cpp 2012-02-28 20:12:04 UTC (rev 681)
+++ trunk/themis/modules/CSSRenderer/TableRowDisplayView.cpp 2012-02-28 22:12:26 UTC (rev 682)
@@ -141,8 +141,26 @@
mRect.bottom = restRect.top;
// mRect.PrintToStream();
+ // Calculating the cell heights.
+ float maxHeight = 0;
+ float childHeight = 0;
+ for (unsigned int i = 0; i < length; i++) {
+ CSSView * childView = mChildren[i];
+ BRect childRect = childView->Bounds();
+ childHeight = childRect.Height();
+ if (maxHeight < childHeight) {
+ maxHeight = childHeight;
+ }
+ }
+
+ // Only setting them to the max height.
+ // Counting on the row group parent to force a recalculation of the layout for now.
+ for (unsigned int i = 0; i < length; i++) {
+ CSSView * childView = mChildren[i];
+ childView->SetHeight(maxHeight);
+ }
+
// Add any margins
-
mRect.bottom += mMarginBottom;
mRect.right += mMarginRight;
mEndPoint.Set(mRect.right, mRect.bottom);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|