Skip to content

Commit 280f223

Browse files
committed
allow 0.1 steps for offsets to avoid double borders
1 parent c79e674 commit 280f223

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

Display.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ function MPT:CreateStates(preview)
103103
F:SetScript("OnDragStop", function(Frame)
104104
Frame:StopMovingOrSizing()
105105
local Anchor, _, relativeTo, xOffset, yOffset = Frame:GetPoint()
106-
xOffset = Round(xOffset)
107-
yOffset = Round(yOffset)
106+
xOffset = math.floor(xOffset * 10 + 0.5) / 10
107+
yOffset = math.floor(yOffset * 10 + 0.5) / 10
108108
self:SetSV({"Position", "xOffset"}, xOffset)
109109
self:SetSV({"Position", "yOffset"}, yOffset)
110110
self:SetSV({"Position", "Anchor"}, Anchor)

UI.lua

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ function MPT:CreateStatusBarSettings(name, key, order)
100100
settings.args.Width = self:CreateRange(4, "Width", "Width of the Status Bar", 50, 1000, 1, {key, "Width"}, true)
101101
settings.args.Height = self:CreateRange(5, "Height", "Height of the Status Bar", 6, 100, 1, {key, "Height"}, true)
102102
settings.args.Texture = self:CreateDropDown(6, "textures", "Texture", "", {key, "Texture"}, true)
103-
settings.args.xOffset = self:CreateRange(7, "X Offset", "X Offset of the Status Bar", -300, 300, 1, {key, "xOffset"}, true)
104-
settings.args.yOffset = self:CreateRange(8, "Y Offset", "Y Offset of the Status Bar", -300, 300, 1, {key, "yOffset"}, true)
103+
settings.args.xOffset = self:CreateRange(7, "X Offset", "X Offset of the Status Bar", -300, 300, 0.1, {key, "xOffset"}, true)
104+
settings.args.yOffset = self:CreateRange(8, "Y Offset", "Y Offset of the Status Bar", -300, 300, 0.1, {key, "yOffset"}, true)
105105
settings.args.SizeGap = self:CreateSpace(9)
106106
settings.args.BorderSize = self:CreateRange(10, "Border Size", "Size of the Border", 1, 10, 1, {key, "BorderSize"}, true)
107107
settings.args.BorderColor = self:CreateColor(11, "Border Color", "", {key, "BorderColor"}, true)
@@ -267,11 +267,11 @@ local Background = {
267267
enabled = MPT:CreateToggle(1, "Enable", "Enable Background", {"Background", "enabled"}, true),
268268
Color = MPT:CreateColor(2, "Color", "Color of the Background", {"Background", "Color"}, true),
269269
BorderColor = MPT:CreateColor(3, "Border Color", "Color of the Border", {"Background", "BorderColor"}, true),
270-
xOffset = MPT:CreateRange(4, "X Offset", "X Offset of the Background", -300, 300, 1, {"Background", "xOffset"}, true),
271-
yOffset = MPT:CreateRange(5, "Y Offset", "Y Offset of the Background", -300, 300, 1, {"Background", "yOffset"}, true),
270+
xOffset = MPT:CreateRange(4, "X Offset", "X Offset of the Background", -300, 300, 0.1, {"Background", "xOffset"}, true),
271+
yOffset = MPT:CreateRange(5, "Y Offset", "Y Offset of the Background", -300, 300, 0.1, {"Background", "yOffset"}, true),
272272
BorderSize = MPT:CreateRange(6, "Border Size", "Size of the Border", 1, 10, 1, {"Background", "BorderSize"}, true),
273-
WidthOffset = MPT:CreateRange(7, "Width Offset", "Additional or less Width", -300, 300, 1, {"Background", "WidthOffset"}, true),
274-
HeightOffset = MPT:CreateRange(8, "Height Offset", "Additional or less Height", -300, 300, 1, {"Background", "HeightOffset"}, true),
273+
WidthOffset = MPT:CreateRange(7, "Width Offset", "Additional or less Width", -300, 300, 0.1, {"Background", "WidthOffset"}, true),
274+
HeightOffset = MPT:CreateRange(8, "Height Offset", "Additional or less Height", -300, 300, 0.1, {"Background", "HeightOffset"}, true),
275275
}
276276
}
277277

@@ -335,8 +335,8 @@ local GeneralOptions = {
335335
Anchor = MPT:CreateDropDown(10, {["CENTER"] = "CENTER", ["TOP"] = "TOP", ["BOTTOM"] = "BOTTOM", ["LEFT"] = "LEFT", ["RIGHT"] = "RIGHT", ["TOPLEFT"] = "TOPLEFT", ["TOPRIGHT"] = "TOPRIGHT", ["BOTTOMLEFT"] = "BOTTOMLEFT", ["BOTTOMRIGHT"] = "BOTTOMRIGHT"}, "Anchor", "", {"Position", "Anchor"}, true),
336336
relativeTo = MPT:CreateDropDown(11, {["CENTER"] = "CENTER", ["TOP"] = "TOP", ["BOTTOM"] = "BOTTOM", ["LEFT"] = "LEFT", ["RIGHT"] = "RIGHT", ["TOPLEFT"] = "TOPLEFT", ["TOPRIGHT"] = "TOPRIGHT", ["BOTTOMLEFT"] = "BOTTOMLEFT", ["BOTTOMRIGHT"] = "BOTTOMRIGHT"}, "Relative To", "", {"Position", "relativeTo"}, true),
337337
Gap = MPT:CreateSpace(12),
338-
xOffset = MPT:CreateRange(13, "X Offset", "X Offset", -4000, 4000, 1, {"Position", "xOffset"}, true),
339-
yOffset = MPT:CreateRange(14, "Y Offset", "Y Offset", -4000, 4000, 1, {"Position", "yOffset"}, true),
338+
xOffset = MPT:CreateRange(13, "X Offset", "X Offset", -4000, 4000, 0.1, {"Position", "xOffset"}, true),
339+
yOffset = MPT:CreateRange(14, "Y Offset", "Y Offset", -4000, 4000, 0.1, {"Position", "yOffset"}, true),
340340
}
341341
}
342342
local General = {
@@ -362,8 +362,8 @@ local KeyInfoBar = {
362362
Width = MPT:CreateRange(4, "Width", "Width of the Key Info Bar", 50, 1000, 1, {"KeyInfo", "Width"}, true),
363363
Height = MPT:CreateRange(5, "Height", "Height of the Key Info Bar", 6, 100, 1, {"KeyInfo", "Height"}, true),
364364
Gap = MPT:CreateSpace(6),
365-
xOffset = MPT:CreateRange(7, "X Offset", "X Offset of the Key Info Bar", -300, 300, 1, {"KeyInfo", "xOffset"}, true),
366-
yOffset = MPT:CreateRange(8, "Y Offset", "Y Offset of the Key Info Bar", -300, 300, 1, {"KeyInfo", "yOffset"}, true),
365+
xOffset = MPT:CreateRange(7, "X Offset", "X Offset of the Key Info Bar", -300, 300, 0.1, {"KeyInfo", "xOffset"}, true),
366+
yOffset = MPT:CreateRange(8, "Y Offset", "Y Offset of the Key Info Bar", -300, 300, 0.1, {"KeyInfo", "yOffset"}, true),
367367
}
368368
}
369369
local KeyLevel = MPT:CreateTextSetting("Key Level", "KeyLevel", 2, true)
@@ -498,8 +498,8 @@ local BossesBar = {
498498
Width = MPT:CreateRange(4, "Bosses Bar Width", "Width of the Bosses Bar", 50, 1000, 1, {"Bosses", "Width"}, true),
499499
Height = MPT:CreateRange(5, "Bosses Bar Height", "Height of the Bosses Bar", 6, 100, 1, {"Bosses", "Height"}, true),
500500
Gap = MPT:CreateSpace(6),
501-
XOffset = MPT:CreateRange(7, "Bosses Bar X Offset", "X Offset of the Bosses Bar", -300, 300, 1, {"Bosses", "xOffset"}, true),
502-
YOffset = MPT:CreateRange(8, "Bosses Bar Y Offset", "Y Offset of the Bosses Bar", -300, 300, 1, {"Bosses", "yOffset"}, true),
501+
XOffset = MPT:CreateRange(7, "Bosses Bar X Offset", "X Offset of the Bosses Bar", -300, 300, 0.1, {"Bosses", "xOffset"}, true),
502+
YOffset = MPT:CreateRange(8, "Bosses Bar Y Offset", "Y Offset of the Bosses Bar", -300, 300, 0.1, {"Bosses", "yOffset"}, true),
503503
}
504504
}
505505
local BossName = MPT:CreateTextSetting("Boss Name", "BossName", 2, true)

0 commit comments

Comments
 (0)