Commit c55d9c42 authored by Bas Lijnse's avatar Bas Lijnse

Merge branch 'overlapping-instances' into 'master'

fix or remove overlapping instances

See merge request !351
parents 9c250e2b a63aaf78
Pipeline #32014 passed with stage
in 7 minutes and 4 seconds
......@@ -39,14 +39,14 @@ where
,hand 50 (degrees 1 min) "#666"
,hand 40 (degrees 2 hour) "#999"])
face = [RectElt [WidthAttr "100px",HeightAttr "100px",StyleAttr "fill:#ccc;stroke: #000;stroke-width: 3px"] [XAttr ("0",PX),YAttr ("0",PX)]
face = [RectElt [WidthAttr "100px",HeightAttr "100px",StyleAttr "fill:#ccc;stroke: #000;stroke-width: 3px"] [XAttr (SVGLength "0" PX),YAttr (SVGLength "0" PX)]
:[RectElt [WidthAttr "10px",HeightAttr "2px",StyleAttr "fill: #ddd;"]
[XAttr ("90",PX),YAttr ("50",PX),TransformAttr [RotateTransform (toString (30*i)) (Just ("50","50"))]] \\ i <- [0..11]
[XAttr (SVGLength "90" PX),YAttr (SVGLength "50" PX),TransformAttr [RotateTransform (toString (30*i)) (Just ("50","50"))]] \\ i <- [0..11]
]]
hand len angle color
= RectElt [WidthAttr (toString len +++"px"),HeightAttr "2px",StyleAttr ("fill: "+++color)]
[XAttr ("50",PX),YAttr ("50",PX),TransformAttr [RotateTransform (toString (angle - 90)) (Just ("50","50"))]]
[XAttr (SVGLength "50" PX),YAttr (SVGLength "50" PX),TransformAttr [RotateTransform (toString (angle - 90)) (Just ("50","50"))]]
initUI me world
//Register listener for ui diffs from the server
......
......@@ -56,9 +56,9 @@ where
where
glassgr = RadialGradientElt [IdAttr "glass-gradient"] []
[StopElt [] [OffsetAttr "0%",StopColorAttr "white"],StopElt [] [OffsetAttr "100%",StopColorAttr "white",StopOpacityAttr "0"]]
flaregr = LinearGradientElt [IdAttr "flare-gradient"] [X1Attr ("0",PX),X2Attr ("0",PX),Y1Attr ("0",PX),Y2Attr ("1",PX)]
flaregr = LinearGradientElt [IdAttr "flare-gradient"] [X1Attr (SVGLength "0" PX),X2Attr (SVGLength "0" PX),Y1Attr (SVGLength "0" PX),Y2Attr (SVGLength "1" PX)]
[StopElt [] [OffsetAttr "0%",StopColorAttr "white"],StopElt [] [OffsetAttr "90%",StopColorAttr "white",StopOpacityAttr "0"]]
light val = CircleElt [] [CxAttr ("50",PX),CyAttr ("50",PX),RAttr ("45",PX),FillAttr (PaintColor (SVGColorText val) Nothing)]
glass = CircleElt [StyleAttr "stroke: #000;stroke-width: 8px"] [FillAttr (PaintFuncIRI (IRI ("#glass-gradient")) Nothing),CxAttr ("50",PX),CyAttr ("50",PX),RAttr ("45",PX)]
flare = EllipseElt [] [FillAttr (PaintFuncIRI (IRI ("#flare-gradient")) Nothing),CxAttr ("50",PX),CyAttr ("45",PX),RxAttr ("35",PX),RyAttr ("30",PX)]
light val = CircleElt [] [CxAttr (SVGLength "50" PX),CyAttr (SVGLength "50" PX),RAttr (SVGLength "45" PX),FillAttr (PaintColor (SVGColorText val) Nothing)]
glass = CircleElt [StyleAttr "stroke: #000;stroke-width: 8px"] [FillAttr (PaintFuncIRI (IRI ("#glass-gradient")) Nothing),CxAttr (SVGLength "50" PX),CyAttr (SVGLength "50" PX),RAttr (SVGLength "45" PX)]
flare = EllipseElt [] [FillAttr (PaintFuncIRI (IRI ("#flare-gradient")) Nothing),CxAttr (SVGLength "50" PX),CyAttr (SVGLength "45" PX),RxAttr (SVGLength "35" PX),RyAttr (SVGLength "30" PX)]
......@@ -724,7 +724,7 @@ where
,icon = Just (LeafletIconID "cursor"),title=Nothing,popup=Nothing}
icon = {LeafletIcon|iconId=LeafletIconID "cursor", iconUrl= svgIconURL (CircleElt hattrs sattrs) (10,10), iconSize = (10,10)}
where
sattrs = [CxAttr ("5",PX),CyAttr ("5",PX),RAttr ("3",PX)]
sattrs = [CxAttr (SVGLength "5" PX),CyAttr (SVGLength "5" PX),RAttr (SVGLength "3" PX)]
hattrs = [StyleAttr "fill:none;stroke:#00f;stroke-width:2"]
toggle (LeafletObjectID "cursor") xs = xs //The cursor can't be selected
......
......@@ -1092,13 +1092,13 @@ where
= StrokeAttr (PaintColor color Nothing)
genSVGImageAttr (BasicImgStrokeWidthAttr (PxSpan w))
#! w` = toString w
= StrokeWidthAttr (StrokeWidthLength (w`, PX))
= StrokeWidthAttr (StrokeWidthLength (SVGLength w` PX))
genSVGImageAttr (BasicImgXRadiusAttr (PxSpan r))
#! r` = toString r
= RxAttr (r`, PX)
= RxAttr (SVGLength r` PX)
genSVGImageAttr (BasicImgYRadiusAttr (PxSpan r))
#! r` = toString r
= RyAttr (r`, PX)
= RyAttr (SVGLength r` PX)
genSVGImageAttr (BasicImgStrokeOpacityAttr op)
= StrokeOpacityAttr (toString op)
genSVGImageAttr (BasicImgFillOpacityAttr op)
......@@ -1130,7 +1130,7 @@ where
Just _ = abort (lookupSpanErrorMsg "genSVGBasicHostImg" (unresolvedErrorMsg "rect"))
nothing = abort (lookupSpanErrorMsg "genSVGBasicHostImg" (unavailableErrorMsg "rect"))
genSVGBasicHostImg no CircleImg attrs taskId es markers paths spans grids
#! elt = CircleElt [] [RAttr (radius,PX), CxAttr (radius,PX), CyAttr (radius,PX) : attrs]
#! elt = CircleElt [] [RAttr (SVGLength radius PX), CxAttr (SVGLength radius PX), CyAttr (SVGLength radius PX) : attrs]
= [elt]
where
radius = case 'Data.Map'.get no spans of
......@@ -1138,7 +1138,7 @@ where
Just (_,_) = abort (lookupSpanErrorMsg "genSVGBasicHostImg" (unresolvedErrorMsg "circle"))
nothing = abort (lookupSpanErrorMsg "genSVGBasicHostImg" (unavailableErrorMsg "circle"))
genSVGBasicHostImg no EllipseImg attrs taskId es markers paths spans grids
#! elt = EllipseElt [] [RxAttr (xradius,PX), CxAttr (xradius,PX), RyAttr (yradius,PX), CyAttr (yradius,PX) : attrs]
#! elt = EllipseElt [] [RxAttr (SVGLength xradius PX), CxAttr (SVGLength xradius PX), RyAttr (SVGLength yradius PX), CyAttr (SVGLength yradius PX) : attrs]
= [elt]
where
(xradius,yradius) = case 'Data.Map'.get no spans of
......@@ -1184,10 +1184,10 @@ where
= ( MarkerElt [ IdAttr mid ]
[ OrientAttr "auto"
, ViewBoxAttr "0" "0" wStr hStr
, RefXAttr (wStr, PX)
, RefYAttr (to2decString (h / 2.0), PX)
, MarkerHeightAttr (hStr, PX)
, MarkerWidthAttr (wStr, PX)
, RefXAttr (SVGLength wStr PX)
, RefYAttr (SVGLength (to2decString (h / 2.0)) PX)
, MarkerHeightAttr (SVGLength hStr PX)
, MarkerWidthAttr (SVGLength wStr PX)
]
(genSVGElts img taskId es markers paths spans grids)
, posAttr (mkUrl mid)
......@@ -1256,7 +1256,7 @@ where
f (RectElt hattrs attrs) = RectElt hattrs (keepTransformAttrsTogether tfattr attrs)
f (CircleElt hattrs [TransformAttr [TranslateTransform x` y`] : attrs]) = CircleElt hattrs (keepTransformAttrsTogether (dualTransformTranslate x y x` y`) attrs)
f (CircleElt hattrs attrs) = CircleElt hattrs (keepTransformAttrsTogether tfattr attrs)
f (LineElt _ [X1Attr (x1, PX), X2Attr (x2, PX), Y1Attr (y1, PX), Y2Attr (y2, PX) : attrs]) = LineElt [] [X1Attr (lineAdd x1 x, PX), X2Attr (lineAdd x2 x, PX), Y1Attr (lineAdd y1 y, PX), Y2Attr (lineAdd y2 y, PX) : attrs]
f (LineElt _ [X1Attr (SVGLength x1 PX), X2Attr (SVGLength x2 PX), Y1Attr (SVGLength y1 PX), Y2Attr (SVGLength y2 PX) : attrs]) = LineElt [] [X1Attr (SVGLength (lineAdd x1 x) PX), X2Attr (SVGLength (lineAdd x2 x) PX), Y1Attr (SVGLength (lineAdd y1 y) PX), Y2Attr (SVGLength (lineAdd y2 y) PX) : attrs]
f elt = GElt [] [tfattr] [elt]
lineAdd :: !String !SVGNumber -> String
......
......@@ -939,7 +939,7 @@ instance Writeable SDSDebug where
db (Error e, iworld) = (Error e, iShow [snd e] iworld)
db (Ok (WriteResult notify sds), iworld)
= (Ok (WriteResult notify (SDSDebug name sds)),
iShow ["WriteResult from share " + name + " notifying: " +++ 'Text'.join " " (map toString ('Set'.toList notify))] iworld)
iShow ["WriteResult from share " + name + " notifying: " +++ 'Text'.join " " (map notifyToString ('Set'.toList notify))] iworld)
db (Ok (AsyncWrite sds), iworld)
= (Ok (AsyncWrite (SDSDebug name sds)), iShow ["AsyncWrite from share " +++ name] iworld)
......@@ -958,7 +958,7 @@ instance Modifiable SDSDebug where
db (Error e, iworld) = (Error e, iShow [snd e] iworld)
db (Ok (ModifyResult notify r w sds), iworld)
= (Ok (ModifyResult notify r w (SDSDebug name sds)),
iShow ["ModifyResult from share " + name + " notifying: " + 'Text'.join ", " (map toString ('Set'.toList notify))] iworld)
iShow ["ModifyResult from share " + name + " notifying: " + 'Text'.join ", " (map notifyToString ('Set'.toList notify))] iworld)
db (Ok (AsyncModify sds f), iworld) = (Ok (AsyncModify (SDSDebug name sds) f), iShow ["AsyncModify from share " + name] iworld)
readSDSDebug :: !(SDSDebug p r w) !p !TaskContext !(Maybe (!TaskId, !SDSIdentity)) !*IWorld
......@@ -975,9 +975,9 @@ readSDSDebug (SDSDebug name sds) p context mbRegister iworld
= (Ok (AsyncRead (SDSDebug name sds)), iShow ["AsyncRead " +++ name] iworld)
// toString instances for SDSDebug
instance toString (TaskId, Maybe RemoteNotifyOptions) where
toString (taskId, Nothing) = "local " +++ toString taskId
toString (taskId, (Just remote)) = "remote " +++ toString taskId +++ " " +++ toString remote
notifyToString :: (TaskId, Maybe RemoteNotifyOptions) -> String
notifyToString (taskId, Nothing) = "local " +++ toString taskId
notifyToString (taskId, (Just remote)) = "remote " +++ toString taskId +++ " " +++ toString remote
instance toString RemoteNotifyOptions where
toString {hostToNotify, portToNotify, remoteSdsId} = hostToNotify +++ ":" +++ toString portToNotify +++ "@" +++ remoteSdsId
......
......@@ -14,7 +14,7 @@ import Text.HTML.GenJSON
import System.Time.GenJSON
from Text.HTML import :: HtmlAttr
from Text.HTML import :: SVGElt, :: SVGAttr, :: SVGAlign, :: SVGColor, :: SVGDefer, :: SVGFillOpacity, :: SVGFuncIRI, :: SVGLengthAdjust
from Text.HTML import :: SVGElt, :: SVGAttr, :: SVGAlign, :: SVGColor, :: SVGDefer, :: SVGFillOpacity, :: SVGFuncIRI, :: SVGLengthAdjust, :: SVGLength, :: SVGICCColor, :: SVGNumber
from Text.HTML import :: SVGLengthUnit, :: SVGLineCap, :: SVGFillRule, :: SVGLineJoin, :: SVGMeetOrSlice, :: SVGStrokeMiterLimit, :: SVGPaint
from Text.HTML import :: SVGStrokeDashArray, :: SVGStrokeDashOffset, :: SVGStrokeWidth, :: SVGTransform, :: SVGZoomAndPan
......@@ -23,8 +23,8 @@ derive gEq (->), Dynamic
derive gEditor HtmlAttr
derive gText HtmlAttr
derive gEditor SVGElt, SVGAttr, SVGAlign, SVGColor, SVGDefer, SVGFillOpacity, SVGFuncIRI, SVGLengthAdjust, SVGLengthUnit, SVGLineCap, SVGFillRule, SVGLineJoin, SVGMeetOrSlice, SVGStrokeMiterLimit, SVGPaint, SVGStrokeDashArray, SVGStrokeDashOffset, SVGStrokeWidth, SVGTransform, SVGZoomAndPan
derive gText SVGElt, SVGAttr, SVGAlign, SVGColor, SVGDefer, SVGFillOpacity, SVGFuncIRI, SVGLengthAdjust, SVGLengthUnit, SVGLineCap, SVGFillRule, SVGLineJoin, SVGMeetOrSlice, SVGStrokeMiterLimit, SVGPaint, SVGStrokeDashArray, SVGStrokeDashOffset, SVGStrokeWidth, SVGTransform, SVGZoomAndPan
derive gEditor SVGElt, SVGAttr, SVGAlign, SVGColor, SVGDefer, SVGFillOpacity, SVGFuncIRI, SVGLengthAdjust, SVGLengthUnit, SVGLineCap, SVGFillRule, SVGLineJoin, SVGMeetOrSlice, SVGStrokeMiterLimit, SVGPaint, SVGStrokeDashArray, SVGStrokeDashOffset, SVGStrokeWidth, SVGTransform, SVGZoomAndPan, SVGLength, SVGICCColor
derive gText SVGElt, SVGAttr, SVGAlign, SVGColor, SVGDefer, SVGFillOpacity, SVGFuncIRI, SVGLengthAdjust, SVGLengthUnit, SVGLineCap, SVGFillRule, SVGLineJoin, SVGMeetOrSlice, SVGStrokeMiterLimit, SVGPaint, SVGStrokeDashArray, SVGStrokeDashOffset, SVGStrokeWidth, SVGTransform, SVGZoomAndPan, SVGLength, SVGICCColor
derive gEditor {}
derive gText {}
......
......@@ -20,8 +20,8 @@ gEq{|Dynamic|} _ _ = False // dynamics are never equal
gEditor{|{}|} _ _ tjx fjx = emptyEditorWithDefaultInEnterMode_ (JSONEncode{|* -> *|} tjx) (JSONDecode{|* -> *|} fjx) {}
gText{|{}|} _ _ _ = []
derive gEditor SVGElt, SVGAttr, SVGAlign, SVGColor, SVGDefer, SVGFillOpacity, SVGFuncIRI, SVGLengthAdjust, SVGLengthUnit, SVGLineCap, SVGFillRule, SVGLineJoin, SVGMeetOrSlice, SVGStrokeMiterLimit, SVGPaint, SVGStrokeDashArray, SVGStrokeDashOffset, SVGStrokeWidth, SVGTransform, SVGZoomAndPan
derive gText SVGElt, SVGAttr, SVGAlign, SVGColor, SVGDefer, SVGFillOpacity, SVGFuncIRI, SVGLengthAdjust, SVGLengthUnit, SVGLineCap, SVGFillRule, SVGLineJoin, SVGMeetOrSlice, SVGStrokeMiterLimit, SVGPaint, SVGStrokeDashArray, SVGStrokeDashOffset, SVGStrokeWidth, SVGTransform, SVGZoomAndPan
derive gEditor SVGElt, SVGAttr, SVGAlign, SVGColor, SVGDefer, SVGFillOpacity, SVGFuncIRI, SVGLengthAdjust, SVGLengthUnit, SVGLineCap, SVGFillRule, SVGLineJoin, SVGMeetOrSlice, SVGStrokeMiterLimit, SVGPaint, SVGStrokeDashArray, SVGStrokeDashOffset, SVGStrokeWidth, SVGTransform, SVGZoomAndPan, SVGLength, SVGICCColor
derive gText SVGElt, SVGAttr, SVGAlign, SVGColor, SVGDefer, SVGFillOpacity, SVGFuncIRI, SVGLengthAdjust, SVGLengthUnit, SVGLineCap, SVGFillRule, SVGLineJoin, SVGMeetOrSlice, SVGStrokeMiterLimit, SVGPaint, SVGStrokeDashArray, SVGStrokeDashOffset, SVGStrokeWidth, SVGTransform, SVGZoomAndPan, SVGLength, SVGICCColor
derive gEditor HtmlAttr
derive gText HtmlAttr
......
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