Improve window dragging
This commit is contained in:
@@ -47,6 +47,8 @@ secondColumnLDP = defaultLDP & ldpPos . spPixelOff .~ V2 subInvX (-20)
|
|||||||
|
|
||||||
terminalLDP :: LDParams
|
terminalLDP :: LDParams
|
||||||
terminalLDP = secondColumnLDP & ldpSize ?~ V2 50 16
|
terminalLDP = secondColumnLDP & ldpSize ?~ V2 50 16
|
||||||
|
& ldpPos . spScreenOff .~ V2 0.5 0.5
|
||||||
|
& ldpPos . spPixelOff .~ V2 (-250) (-40)
|
||||||
|
|
||||||
subInvX :: Float
|
subInvX :: Float
|
||||||
subInvX = 10 * fromIntegral topInvW + 170
|
subInvX = 10 * fromIntegral topInvW + 170
|
||||||
|
|||||||
@@ -134,8 +134,11 @@ setPixelOffsetBounded cfig (V2 x y) ldp = ldp & ldpPos . spPixelOff .~ V2 x' y'
|
|||||||
where
|
where
|
||||||
h = fromIntegral $ cfig ^. windowY
|
h = fromIntegral $ cfig ^. windowY
|
||||||
w = fromIntegral $ cfig ^. windowX
|
w = fromIntegral $ cfig ^. windowX
|
||||||
x' = min (w - (1+10*ldp ^?! ldpSize . _Just . _x . to fromIntegral)) $ max 1 x
|
x' = min (w - (w*a + 1+10*ldp ^?! ldpSize . _Just . _x . to fromIntegral))
|
||||||
y' = max (1+20*(ldp^.ldpVerticalGap + ldp^?!ldpSize._Just._y.to fromIntegral)-h) y
|
$ max (1 - w * a) x
|
||||||
|
y' = min (h-(h*b + 40))
|
||||||
|
$ max (1+20*(ldp^.ldpVerticalGap + ldp^?!ldpSize._Just._y.to fromIntegral)-h*b) y
|
||||||
|
V2 a b = ldp ^. ldpPos . spScreenOff
|
||||||
|
|
||||||
--leftHeldPosShift :: World -> Point2
|
--leftHeldPosShift :: World -> Point2
|
||||||
--leftHeldPosShift w = fromMaybe 0 $ do
|
--leftHeldPosShift w = fromMaybe 0 $ do
|
||||||
|
|||||||
Reference in New Issue
Block a user