Skip to content

Commit

Permalink
fix font size in text presets not applying
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Jan 7, 2025
1 parent f2b2a9d commit bd7a18b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/qml/filters/dynamictext/ui.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2024 Meltytech, LLC
* Copyright (c) 2014-2025 Meltytech, LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -164,6 +164,7 @@ Shotcut.KeyframableFilter {
parameters: textFilterUi.parameterList.concat(['argument'])
onBeforePresetLoaded: {
filter.resetProperty(textFilterUi.rectProperty);
filter.set(textFilterUi.pointSizeProperty, 0);
resetSimpleKeyframes();
}
onPresetSelected: {
Expand Down
3 changes: 2 additions & 1 deletion src/qml/filters/gpstext/ui.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024 Meltytech, LLC
* Copyright (c) 2022-2025 Meltytech, LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -686,6 +686,7 @@ Shotcut.KeyframableFilter {
parameters: textFilterUi.parameterList.concat(['argument'])
onBeforePresetLoaded: {
filter.resetProperty(textFilterUi.rectProperty);
filter.set(textFilterUi.pointSizeProperty, 0);
resetSimpleKeyframes();
}
onPresetSelected: {
Expand Down
3 changes: 2 additions & 1 deletion src/qml/filters/subtitle/ui.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Meltytech, LLC
* Copyright (c) 2024-2025 Meltytech, LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -90,6 +90,7 @@ Shotcut.KeyframableFilter {
parameters: textFilterUi.parameterList.concat(['feed'])
onBeforePresetLoaded: {
filter.resetProperty(textFilterUi.rectProperty);
filter.set(textFilterUi.pointSizeProperty, 0);
resetSimpleKeyframes();
}
onPresetSelected: {
Expand Down
3 changes: 2 additions & 1 deletion src/qml/filters/timer/ui.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2024 Meltytech, LLC
* Copyright (c) 2018-2025 Meltytech, LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -124,6 +124,7 @@ Shotcut.KeyframableFilter {
parameters: textFilterUi.parameterList.concat(['format', 'direction', 'start', 'duration'])
onBeforePresetLoaded: {
filter.resetProperty(textFilterUi.rectProperty);
filter.set(textFilterUi.pointSizeProperty, 0);
resetSimpleKeyframes();
}
onPresetSelected: {
Expand Down
4 changes: 2 additions & 2 deletions src/qml/modules/Shotcut/Controls/TextFilterUi.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2023 Meltytech, LLC
* Copyright (c) 2014-2025 Meltytech, LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -67,7 +67,7 @@ GridLayout {
var pointSize = parseInt(filter.get(pointSizeProperty));
if (!pointSize) {
var ratio = fontDialog.selectedFont.pointSize / fontDialog.selectedFont.pixelSize;
pointSize = filter.get('size') * ratio;
pointSize = Math.round(filter.get('size') * ratio);
}
return pointSize;
}
Expand Down

0 comments on commit bd7a18b

Please sign in to comment.