Esempio n. 1
0
        public override void Render(ISystemContext sysCtxt, Matrix parentXform)
        {
            ProteusContext pctxt = sysCtxt as ProteusContext;

            pctxt.Log("current\n" + Transformation.ToString());
            Matrix postMult = parentXform.Multiply(Transformation);

            pctxt.Log("post multiply\n" + postMult.ToString());
            Point pos = postMult.TransformPoint(new Point(0, 0));

            pctxt.Log("pos=" + pos.ToString());
            pctxt.JsRuntime.InvokeVoid("Proteus.setElementLayout",
                                       _htmlElement, pos.X, pos.Y, Size.Width, Size.Height);
        }
Esempio n. 2
0
 public ProteusComponent(ProteusContext ctxt, string html)
 {
     _htmlElement = ctxt.JsRuntime.Invoke <IJSObjectReference>(
         "Proteus.htmlToElement", html);
     float[] sizeArray = ctxt.JsRuntime.Invoke <float[]>(
         "Proteus.getElementSize", _htmlElement);
     PreferredSize = new Size(sizeArray[0], sizeArray[1]);
     ctxt.Log("preferred size=" + PreferredSize.Width + "," + PreferredSize.Height);
     MinSize = PreferredSize;
 }