Various styling fixes

This commit is contained in:
barsdeveloper
2023-05-21 02:21:52 +02:00
parent cccae45d7a
commit 6ed6d397a5
14 changed files with 80 additions and 42 deletions

View File

@@ -37,7 +37,7 @@ export default class Configuration {
begin: "blueprint-focus",
end: "blueprint-unfocus",
}
static fontSize = css`12.5px`
static fontSize = css`13px`
static gridAxisLineColor = css`black`
static gridExpandThreshold = 0.25 // remaining size factor threshold to cause an expansion event
static gridLineColor = css`#353535`
@@ -80,7 +80,7 @@ export default class Configuration {
static minZoom = -12
static mouseClickButton = 0
static mouseRightClickButton = 2
static mouseWheelFactor = 0.2
static mouseWheelZoomThreshold = 80
static nodeDragEventName = "ueb-node-drag"
static nodeDragGeneralEventName = "ueb-node-drag-general"
static nodeName = (name, counter) => `${name}_${counter}`
@@ -199,7 +199,7 @@ export default class Configuration {
"wildcard": css`128, 120, 120`,
}
static pinColorMaterial = css`120, 120, 120`
static pinInputWrapWidth = 135 // px
static pinInputWrapWidth = 143 // px
static removeEventName = "ueb-element-delete"
static scale = {
[-12]: 0.133333,

View File

@@ -496,6 +496,7 @@ export default class ObjectEntity extends IEntity {
isEvent() {
switch (this.getClass()) {
case Configuration.paths.componentBoundEvent:
case Configuration.paths.customEvent:
case Configuration.paths.event:
case Configuration.paths.inputAxisKeyEvent:

View File

@@ -1,4 +1,3 @@
import Configuration from "../../Configuration.js"
import IPointing from "./IPointing.js"
/** @typedef {import("../../Blueprint.js").default} Blueprint */
@@ -9,7 +8,7 @@ export default class IMouseWheel extends IPointing {
#mouseWheelHandler = e => {
e.preventDefault()
const location = this.locationFromEvent(e)
this.wheel(Math.sign(e.deltaY * Configuration.mouseWheelFactor), location)
this.wheel(e.deltaY, location)
}
/** @param {WheelEvent} e */

View File

@@ -1,7 +1,10 @@
import Configuration from "../../Configuration.js"
import IMouseWheel from "./IMouseWheel.js"
export default class Zoom extends IMouseWheel {
#accumulatedVariation = 0
#enableZoonIn = false
get enableZoonIn() {
return this.#enableZoonIn
@@ -14,12 +17,18 @@ export default class Zoom extends IMouseWheel {
}
wheel(variation, location) {
this.#accumulatedVariation += -variation
variation = this.#accumulatedVariation
if (Math.abs(this.#accumulatedVariation) < Configuration.mouseWheelZoomThreshold) {
return
} else {
this.#accumulatedVariation = 0
}
let zoomLevel = this.blueprint.getZoom()
variation = -variation
if (!this.enableZoonIn && zoomLevel == 0 && variation > 0) {
return
}
zoomLevel += variation
zoomLevel += Math.sign(variation)
this.blueprint.setZoom(zoomLevel, location)
}
}

View File

@@ -174,10 +174,9 @@ export default class LinkTemplate extends IFromToPositionedTemplate {
render() {
return html`
<svg version="1.2" baseProfile="tiny" width="100%" height="100%" viewBox="0 0 100 100" preserveAspectRatio="none">
<g class="ueb-link-area">
<path id="${this.#uniqueId}" fill="none" vector-effect="non-scaling-stroke" d="${this.element.svgPathD}" />
<use href="#${this.#uniqueId}" pointer-events="stroke" stroke-width="20" />
</g>
<path id="${this.#uniqueId}" fill="none" vector-effect="non-scaling-stroke" d="${this.element.svgPathD}" />
<use href="#${this.#uniqueId}" class="ueb-link-area" pointer-events="all" />
<use href="#${this.#uniqueId}" class="ueb-link-path" pointer-events="none" />
</svg>
${this.element.linkMessageIcon || this.element.linkMessageText ? html`
<div class="ueb-link-message">