Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
Aegisub
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Déploiement
Releases
Registre de paquets
Registre de conteneurs
Registre de modèles
Opération
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Ce projet est archivé. Le dépôt et les autres ressources du projet sont en lecture seule.
Afficher davantage de fils d'Ariane
Kubat
Aegisub
Validations
f0d35a1c
Valider
f0d35a1c
rédigé
Il y a 11 ans
par
Thomas Goyne
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Retinafy the video display
parent
c8368a50
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
3
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
aegisub/src/retina_helper.mm
+6
-2
6 ajouts, 2 suppressions
aegisub/src/retina_helper.mm
aegisub/src/video_display.cpp
+18
-8
18 ajouts, 8 suppressions
aegisub/src/video_display.cpp
aegisub/src/video_display.h
+6
-1
6 ajouts, 1 suppression
aegisub/src/video_display.h
avec
30 ajouts
et
11 suppressions
aegisub/src/retina_helper.mm
+
6
−
2
Voir le fichier @
f0d35a1c
...
...
@@ -42,15 +42,19 @@ RetinaHelper::RetinaHelper(wxWindow *window)
:
window
(
window
)
,
observer
([
RetinaObserver
new
])
{
NSView
*
view
=
window
->
GetHandle
();
RetinaObserver
*
obs
=
(
id
)
observer
;
obs
.
window
=
window
->
GetHandle
()
.
window
;
obs
.
window
=
view
.
window
;
obs
.
block
=
^
{
ScaleFactorChanged
(
GetScaleFactor
());
};
NSNotificationCenter
*
nc
=
NSNotificationCenter
.
defaultCenter
;
[
nc
addObserver
:(
id
)
observer
selector:
@selector
(
backingPropertiesDidChange
:)
name
:
NSWindowDidChangeBackingPropertiesNotification
object
:
window
->
GetHandle
().
window
];
object
:
view
.
window
];
if
([
view
respondsToSelector
:
@selector
(
setWantsBestResolutionOpenGLSurface
:)])
view
.
wantsBestResolutionOpenGLSurface
=
YES
;
}
RetinaHelper
::~
RetinaHelper
()
{
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
aegisub/src/video_display.cpp
+
18
−
8
Voir le fichier @
f0d35a1c
...
...
@@ -43,6 +43,7 @@
#include
"include/aegisub/hotkey.h"
#include
"include/aegisub/menu.h"
#include
"options.h"
#include
"retina_helper.h"
#include
"spline_curve.h"
#include
"subs_controller.h"
#include
"threaded_frame_source.h"
...
...
@@ -99,6 +100,13 @@ VideoDisplay::VideoDisplay(
,
toolBar
(
visualSubToolBar
)
,
zoomBox
(
zoomBox
)
,
freeSize
(
freeSize
)
,
retina_helper
(
agi
::
util
::
make_unique
<
RetinaHelper
>
(
this
))
,
scale_factor
(
retina_helper
->
GetScaleFactor
())
,
scale_factor_connection
(
retina_helper
->
AddScaleFactorListener
([
=
](
int
new_scale_factor
)
{
double
new_zoom
=
zoomValue
*
new_scale_factor
/
scale_factor
;
scale_factor
=
new_scale_factor
;
SetZoom
(
new_zoom
);
}))
{
zoomBox
->
SetValue
(
wxString
::
Format
(
"%g%%"
,
zoomValue
*
100.
));
zoomBox
->
Bind
(
wxEVT_COMBOBOX
,
&
VideoDisplay
::
SetZoomFromBox
,
this
);
...
...
@@ -199,7 +207,7 @@ void VideoDisplay::Render() try {
E
(
glMatrixMode
(
GL_PROJECTION
));
E
(
glLoadIdentity
());
E
(
glOrtho
(
0.0f
,
videoSize
.
GetWidth
(),
videoSize
.
GetHeight
(),
0.0f
,
-
1000.0f
,
1000.0f
));
E
(
glOrtho
(
0.0f
,
videoSize
.
GetWidth
()
/
scale_factor
,
videoSize
.
GetHeight
()
/
scale_factor
,
0.0f
,
-
1000.0f
,
1000.0f
));
if
(
OPT_GET
(
"Video/Overscan Mask"
)
->
GetBool
())
{
double
ar
=
con
->
videoController
->
GetAspectRatioValue
();
...
...
@@ -272,7 +280,7 @@ void VideoDisplay::PositionVideo() {
if
(
!
con
->
videoController
->
IsLoaded
()
||
!
IsShownOnScreen
())
return
;
viewport_left
=
0
;
viewport_bottom
=
GetClientSize
().
GetHeight
()
-
videoSize
.
GetHeight
();
viewport_bottom
=
GetClientSize
().
GetHeight
()
*
scale_factor
-
videoSize
.
GetHeight
();
viewport_top
=
0
;
viewport_width
=
videoSize
.
GetWidth
();
viewport_height
=
videoSize
.
GetHeight
();
...
...
@@ -300,7 +308,8 @@ void VideoDisplay::PositionVideo() {
}
if
(
tool
)
tool
->
SetDisplayArea
(
viewport_left
,
viewport_top
,
viewport_width
,
viewport_height
);
tool
->
SetDisplayArea
(
viewport_left
/
scale_factor
,
viewport_top
/
scale_factor
,
viewport_width
/
scale_factor
,
viewport_height
/
scale_factor
);
Render
();
}
...
...
@@ -320,12 +329,12 @@ void VideoDisplay::UpdateSize() {
wxSize
cs
=
GetClientSize
();
wxSize
oldSize
=
top
->
GetSize
();
top
->
SetSize
(
top
->
GetSize
()
+
videoSize
-
cs
);
top
->
SetSize
(
top
->
GetSize
()
+
videoSize
/
scale_factor
-
cs
);
SetClientSize
(
cs
+
top
->
GetSize
()
-
oldSize
);
}
else
{
SetMinClientSize
(
videoSize
);
SetMaxClientSize
(
videoSize
);
SetMinClientSize
(
videoSize
/
scale_factor
);
SetMaxClientSize
(
videoSize
/
scale_factor
);
GetGrandParent
()
->
Layout
();
}
...
...
@@ -335,7 +344,7 @@ void VideoDisplay::UpdateSize() {
void
VideoDisplay
::
OnSizeEvent
(
wxSizeEvent
&
event
)
{
if
(
freeSize
)
{
videoSize
=
GetClientSize
();
videoSize
=
GetClientSize
()
*
scale_factor
;
PositionVideo
();
zoomValue
=
double
(
viewport_height
)
/
con
->
videoController
->
GetHeight
();
zoomBox
->
ChangeValue
(
wxString
::
Format
(
"%g%%"
,
zoomValue
*
100.
));
...
...
@@ -419,7 +428,8 @@ void VideoDisplay::SetTool(std::unique_ptr<VisualToolBase> new_tool) {
else
{
// UpdateSize fits the window to the video, which we don't want to do
GetGrandParent
()
->
Layout
();
tool
->
SetDisplayArea
(
viewport_left
,
viewport_top
,
viewport_width
,
viewport_height
);
tool
->
SetDisplayArea
(
viewport_left
/
scale_factor
,
viewport_top
/
scale_factor
,
viewport_width
/
scale_factor
,
viewport_height
/
scale_factor
);
}
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
aegisub/src/video_display.h
+
6
−
1
Voir le fichier @
f0d35a1c
...
...
@@ -42,13 +42,14 @@
#include
<wx/glcanvas.h>
// Prototypes
struct
FrameReadyEvent
;
class
RetinaHelper
;
class
VideoContext
;
class
VideoOutGL
;
class
VisualToolBase
;
class
wxComboBox
;
class
wxTextCtrl
;
class
wxToolBar
;
struct
FrameReadyEvent
;
struct
VideoFrame
;
namespace
agi
{
...
...
@@ -106,6 +107,10 @@ class VideoDisplay : public wxGLCanvas {
/// Frame which will replace the currently visible frame on the next render
std
::
shared_ptr
<
VideoFrame
>
pending_frame
;
std
::
unique_ptr
<
RetinaHelper
>
retina_helper
;
int
scale_factor
;
agi
::
signal
::
Connection
scale_factor_connection
;
/// @brief Draw an overscan mask
/// @param horizontal_percent The percent of the video reserved horizontally
/// @param vertical_percent The percent of the video reserved vertically
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter