X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fmodel%2Fcomponents%2FSubmodelComponent.java;h=fe3ec07e81e77fea360b65600850837118bbc194;hb=ecbe58f5d8beb7c90e6cc1c7ae84df33ef07e80a;hp=eca0df697efb39c352886b72e92897af80574350;hpb=e670d6ab4c81bfb65640333a3116ecb1357ad3fa;p=Mograsim.git diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SubmodelComponent.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SubmodelComponent.java index eca0df69..fe3ec07e 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SubmodelComponent.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SubmodelComponent.java @@ -5,7 +5,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; -import net.haspamelodica.swt.helper.gcs.GCDefaultConfig; +import net.haspamelodica.swt.helper.gcs.GCConfig; import net.haspamelodica.swt.helper.gcs.GeneralGC; import net.haspamelodica.swt.helper.gcs.TranslatedGC; import net.haspamelodica.swt.helper.swtobjectwrappers.Font; @@ -45,7 +45,7 @@ public class SubmodelComponent extends GUIComponent this.label = label; this.submodelScale = 1; - this.maxVisibleRegionFillRatioForAlpha0 = 0.1; + this.maxVisibleRegionFillRatioForAlpha0 = 0.4; this.minVisibleRegionFillRatioForAlpha1 = 0.8; this.renderer = new LogicUIRenderer(submodelModifiable); @@ -139,7 +139,7 @@ public class SubmodelComponent extends GUIComponent double posX = getBounds().x; double posY = getBounds().y; - GCDefaultConfig conf = new GCDefaultConfig(gc); + GCConfig conf = new GCConfig(gc); TranslatedGC tgc = new TranslatedGC(gc, posX, posY, submodelScale, true); conf.reset(tgc); double visibleRegionFillRatio = Math.max(getBounds().width / visibleRegion.width, getBounds().height / visibleRegion.height); @@ -148,7 +148,7 @@ public class SubmodelComponent extends GUIComponent // we need to take the old alpha into account to support nested submodules better. int oldAlpha = gc.getAlpha(); gc.setAlpha(Math.max(0, Math.min(255, (int) (oldAlpha * alphaFactor)))); - renderer.render(tgc, visibleRegion.translate(posX, posY, submodelScale)); + renderer.render(tgc, visibleRegion.translate(-posX, -posY, 1 / submodelScale)); gc.setAlpha(Math.max(0, Math.min(255, (int) (oldAlpha * (1 - alphaFactor))))); Font oldFont = gc.getFont(); Font labelFont = new Font(oldFont.getName(), 6, oldFont.getStyle());