<div dir="ltr"><div>Of course, here is:</div><div><br></div><div><i>case when "auxiliary_storage_labeling_positionx" < $x and "auxiliary_storage_labeling_positiony" > $y and abs("auxiliary_storage_labeling_positiony"-$y) < abs("auxiliary_storage_labeling_positionx"-$x) THEN <br> make_line($geometry, make_point($x-abs("auxiliary_storage_labeling_positiony"-$y),"auxiliary_storage_labeling_positiony"),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))<br>when  "auxiliary_storage_labeling_positionx" < $x and "auxiliary_storage_labeling_positiony" > $y and abs("auxiliary_storage_labeling_positiony"-$y) >= abs("auxiliary_storage_labeling_positionx"-$x) then <br>  make_line($geometry, make_point($x,abs("auxiliary_storage_labeling_positionx"-$x)+$y),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))<br>when "auxiliary_storage_labeling_positionx" < $x and "auxiliary_storage_labeling_positiony" < $y and abs("auxiliary_storage_labeling_positiony"-$y) < abs("auxiliary_storage_labeling_positionx"-$x) THEN <br>  make_line($geometry, make_point($x-abs("auxiliary_storage_labeling_positiony"-$y),"auxiliary_storage_labeling_positiony"),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))  <br>when  "auxiliary_storage_labeling_positionx" < $x and "auxiliary_storage_labeling_positiony" < $y and abs("auxiliary_storage_labeling_positiony"-$y) >= abs("auxiliary_storage_labeling_positionx"-$x) then <br>  make_line($geometry, make_point($x,$y-abs("auxiliary_storage_labeling_positionx"-$x)),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))<br>when "auxiliary_storage_labeling_positionx" >= $x and "auxiliary_storage_labeling_positiony" > $y and abs("auxiliary_storage_labeling_positiony"-$y) > abs("auxiliary_storage_labeling_positionx"-$x) then --quadrant ur alternatif<br>  make_line($geometry, make_point($x,"auxiliary_storage_labeling_positiony"-abs("auxiliary_storage_labeling_positionx"-$x)),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony")) <br>when "auxiliary_storage_labeling_positionx" >= $x and "auxiliary_storage_labeling_positiony" > $y and abs("auxiliary_storage_labeling_positiony"-$y) < abs("auxiliary_storage_labeling_positionx"-$x) then <br>   make_line($geometry, make_point($x+abs("auxiliary_storage_labeling_positiony"-$y),"auxiliary_storage_labeling_positiony"),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))  <br>when "auxiliary_storage_labeling_positionx" >= $x and "auxiliary_storage_labeling_positiony" <= $y and abs("auxiliary_storage_labeling_positiony"-$y) > abs("auxiliary_storage_labeling_positionx"-$x) THEN <br>  make_line($geometry, make_point($x,$y-abs("auxiliary_storage_labeling_positionx"-$x)),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))  <br>when "auxiliary_storage_labeling_positionx" >= $x and "auxiliary_storage_labeling_positiony" <= $y and abs("auxiliary_storage_labeling_positiony"-$y) < abs("auxiliary_storage_labeling_positionx"-$x) THEN <br> make_line($geometry, make_point($x+abs("auxiliary_storage_labeling_positiony"-$y),"auxiliary_storage_labeling_positiony"),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))  <br>   END</i></div><div><i><br></i></div><div><i><br></i></div></div><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El lun., 11 nov. 2019 17:15, Régis Haubourg <<a href="mailto:regis.haubourg@gmail.com" target="_blank">regis.haubourg@gmail.com</a>> escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Luis, can you share your geometry generator expression please?<br>
regards<br>
Régis<br>
<br>
Le lun. 11 nov. 2019 à 09:04, Luís Miguel Royo Pérez<br>
<<a href="mailto:luis.miguel.royo@gmail.com" rel="noreferrer" target="_blank">luis.miguel.royo@gmail.com</a>> a écrit :<br>
><br>
> Hello everyone,<br>
><br>
> I'm developing a QGIS plugin along with PostGIS and I'm facing some problems with labeling. This plugin creates several layers and tables. Some of these layers are views  (labeling layers), so if I edit the one fo the source layer the view changes and then the label. I explain more detailed:<br>
><br>
> I have the following:<br>
><br>
> One layer. Let's call it layer1.<br>
> One none spatial table. Let's call it table1.<br>
> One spatial view from these other two layers layer1 and table1 meant for labeling. Let's call it labelView1.<br>
><br>
> The point is this, when I edit table1 adding a new element linked by a foreign key with layer1. The label position in labelView1 changes into a messy thing. The Style of labelView1 is the following:<br>
><br>
> Symbol is a geometry generator. Since I want to create callouts from label to the geometry, wich is a point.<br>
> The position of the label is saved on project. In the qgd file.<br>
><br>
> I have seen this behaviour in Windows10 and in Ubuntu. The QGIS version is 3.4, but I tried to move to the new 3.10 version of QGIS, with the callouts new feature, but is the same result.<br>
><br>
> As well I tried to reproduce it in a much simple way, but without succed, that's why I want to share a link with a GIF file showing this issue:<br>
><br>
> <a href="https://gifyu.com/image/vMY7" rel="noreferrer noreferrer" target="_blank">https://gifyu.com/image/vMY7</a><br>
><br>
> I've done the same but without fixed position,and the labels don't move, but the geometry_generator does.<br>
><br>
> Is this a bug? Is there any way to prevent it?<br>
><br>
> Thanks.<br>
> --<br>
> Luís Miguel Royo Pérez.<br>
> Analista-Programador GIS<br>
> C/ Antic Regne de Valencia nº 4. Manises (Valencia)<br>
> Teléfono:+34  679846103<br>
> webs:<br>
> <a href="http://inisig.com" rel="noreferrer noreferrer" target="_blank">inisig.com</a><br>
> <a href="http://geofibra.com" rel="noreferrer noreferrer" target="_blank">geofibra.com</a><br>
><br>
><br>
> _______________________________________________<br>
> QGIS-Developer mailing list<br>
> <a href="mailto:QGIS-Developer@lists.osgeo.org" rel="noreferrer" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div></div></div>