From 9260363fef4db1fec3e446717c9c0000e2a3524e Mon Sep 17 00:00:00 2001 From: Adam Comella Date: Wed, 1 Jun 2016 12:48:51 -0700 Subject: [PATCH] Expose getters and setters for some new properties The properties include overflow and min/max height/width. --- dist/css-layout.jar | Bin 16323 -> 16326 bytes src/csharp/Facebook.CSSLayout/CSSNode.cs | 6 ++ .../src/com/facebook/csslayout/CSSNode.java | 70 ++++++++++++++++++ 3 files changed, 76 insertions(+) diff --git a/dist/css-layout.jar b/dist/css-layout.jar index 9428bb4c648e538acb46d7202ad365f706ab9990..b4ca4e3904a5deae4defa4bb1cbe9ef6c78aecfc 100644 GIT binary patch delta 270 zcmX?Hf2^K2z?+#xgn@&DgMm5y;6z?4W)S7&ZFOY!Z0(F6;;L%TmuOi$7Z-gZt~!lj zYWAn1k420O0p9E!tPA+|I5RLXxBxN2kn?r3Hl7J(V$O*>xLJjHA`3G^`oYaR*w-0@ z8JX5*Odty;FS51Z1=1dHLnc4BHDv~Bo-A)C&2)%i@&Y@J$tiX+@<4MurrbUhrp3a* z&?v>gU<0%b0i-6+xAO*>Jozn9+d6ijHoeIf_R)!&|r@#w-1GB zu`n<+N-;3lAQS*u;>?rn?KCFGF^f(1vgZNWIr)Q~G}CH!s4&}PYkO(1aHPF7Q;aoO Nc%Hoy+hkjiIRMCGOZor+ diff --git a/src/csharp/Facebook.CSSLayout/CSSNode.cs b/src/csharp/Facebook.CSSLayout/CSSNode.cs index 736fa289..bc383c2b 100644 --- a/src/csharp/Facebook.CSSLayout/CSSNode.cs +++ b/src/csharp/Facebook.CSSLayout/CSSNode.cs @@ -317,6 +317,12 @@ namespace Facebook.CSSLayout get { return style.flex; } set { updateFloatValue(ref style.flex, value); } } + + public CSSOverflow Overflow + { + get { return style.overflow; } + set { updateDiscreteValue(ref style.overflow, value); } + } public void SetMargin(CSSSpacingType spacingType, float margin) { diff --git a/src/java/src/com/facebook/csslayout/CSSNode.java b/src/java/src/com/facebook/csslayout/CSSNode.java index 011d98ed..d8b5243d 100644 --- a/src/java/src/com/facebook/csslayout/CSSNode.java +++ b/src/java/src/com/facebook/csslayout/CSSNode.java @@ -447,6 +447,62 @@ public class CSSNode { } } + /** + * Get this node's max width, as defined in the style + */ + public float getStyleMaxWidth() { + return style.maxWidth; + } + + public void setStyleMaxWidth(float maxWidth) { + if (!valuesEqual(style.maxWidth, maxWidth)) { + style.maxWidth = maxWidth; + dirty(); + } + } + + /** + * Get this node's min width, as defined in the style + */ + public float getStyleMinWidth() { + return style.minWidth; + } + + public void setStyleMinWidth(float minWidth) { + if (!valuesEqual(style.minWidth, minWidth)) { + style.minWidth = minWidth; + dirty(); + } + } + + /** + * Get this node's max height, as defined in the style + */ + public float getStyleMaxHeight() { + return style.maxHeight; + } + + public void setStyleMaxHeight(float maxHeight) { + if (!valuesEqual(style.maxHeight, maxHeight)) { + style.maxHeight = maxHeight; + dirty(); + } + } + + /** + * Get this node's min height, as defined in the style + */ + public float getStyleMinHeight() { + return style.minHeight; + } + + public void setStyleMinHeight(float minHeight) { + if (!valuesEqual(style.minHeight, minHeight)) { + style.minHeight = minHeight; + dirty(); + } + } + public float getLayoutX() { return layout.position[POSITION_LEFT]; } @@ -476,6 +532,20 @@ public class CSSNode { } } + /** + * Get this node's overflow property, as defined in the style + */ + public CSSOverflow getOverflow() { + return style.overflow; + } + + public void setOverflow(CSSOverflow overflow) { + if (style.overflow != overflow) { + style.overflow = overflow; + dirty(); + } + } + /** * Resets this instance to its default state. This method is meant to be used when * recycling {@link CSSNode} instances.